@@ -383,7 +383,6 @@ void MultiHistEvaluator::ApplyTreeSplit(Context const *ctx, RegTree const *p_tre
383383 auto sibling_sum = parent_sum[t] - node_sum[t];
384384 if (best_split.dir == kRightDir ) {
385385 // forward pass, node_sum is the left sum
386- // auto lg = quantizer.ToFloatingPoint(node_sum[t]);
387386 left_sum[t] = node_sum[t];
388387 right_sum[t] = sibling_sum;
389388 } else {
@@ -395,20 +394,22 @@ void MultiHistEvaluator::ApplyTreeSplit(Context const *ctx, RegTree const *p_tre
395394 });
396395}
397396
398- void DebugPrintHistogram (common::Span<GradientPairInt64 const > node_hist,
399- common::Span<GradientQuantiser const > roundings, bst_target_t n_targets) {
397+ std::ostream &DebugPrintHistogram (std::ostream &os, common::Span<GradientPairInt64 const > node_hist,
398+ common::Span<GradientQuantiser const > roundings,
399+ bst_target_t n_targets) {
400400 std::vector<GradientQuantiser> h_roundings;
401401 thrust::copy (dh::tcbegin (roundings), dh::tcend (roundings), std::back_inserter (h_roundings));
402402 dh::CopyDeviceSpanToVector (&h_roundings, roundings);
403403
404404 std::vector<GradientPairInt64> h_node_hist (node_hist.size ());
405405 dh::CopyDeviceSpanToVector (&h_node_hist, node_hist);
406406 for (bst_target_t t = 0 ; t < n_targets; ++t) {
407- std::cout << " target :" << t << std::endl;
407+ os << " Target :" << t << std::endl;
408408 for (std::size_t i = t; i < h_node_hist.size () / n_targets; i += n_targets) {
409- std::cout << h_roundings[t].ToFloatingPoint (h_node_hist[i]) << " , " ;
409+ os << h_roundings[t].ToFloatingPoint (h_node_hist[i]) << " , " ;
410410 }
411- std::cout << std::endl;
411+ os << std::endl;
412412 }
413+ return os;
413414}
414415} // namespace xgboost::tree::cuda_impl
0 commit comments