fix: reset hit counter for next batch (#5035)

This commit is contained in:
Sebastian 2019-11-14 03:22:02 +01:00 committed by Jiaming Yuan
parent 2abe69d774
commit 886bf93ba4

View File

@ -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
}
}