From 886bf93ba4cde4b008ba481e9c288551d1876333 Mon Sep 17 00:00:00 2001 From: Sebastian <2028909+sfahnens@users.noreply.github.com> Date: Thu, 14 Nov 2019 03:22:02 +0100 Subject: [PATCH] fix: reset hit counter for next batch (#5035) --- src/common/hist_util.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/hist_util.cc b/src/common/hist_util.cc index b3c67e152..4ead606f6 100644 --- a/src/common/hist_util.cc +++ b/src/common/hist_util.cc @@ -423,6 +423,7 @@ void GHistIndexMatrix::Init(DMatrix* p_fmat, int max_num_bins) { for (bst_omp_uint idx = 0; idx < bst_omp_uint(nbins); ++idx) { for (size_t tid = 0; tid < nthread; ++tid) { hit_count[idx] += hit_count_tloc_[tid * nbins + idx]; + hit_count_tloc_[tid * nbins + idx] = 0; // reset for next batch } }