"python-package/vscode:/vscode.git/clone" did not exist on "2e9848c67f2aceef05f80db7301c52a8a9fa14c9"
Commit e66a8a3c authored by zhangjin's avatar zhangjin Committed by Guolin Ke
Browse files

Update dataset.cpp (#927)

While in parallel training, when one worker have 0 data, then it will not execute ConstructHistogram.
if so, ptr_smaller_leaf_hist_data will not be 0 but the old data. that will get the wrong Histogram, and the wrong split info.
parent 350b4612
...@@ -586,7 +586,7 @@ void Dataset::ConstructHistograms(const std::vector<int8_t>& is_feature_used, ...@@ -586,7 +586,7 @@ void Dataset::ConstructHistograms(const std::vector<int8_t>& is_feature_used,
bool is_constant_hessian, bool is_constant_hessian,
HistogramBinEntry* hist_data) const { HistogramBinEntry* hist_data) const {
if (leaf_idx < 0 || num_data <= 0 || hist_data == nullptr) { if (leaf_idx < 0 || num_data < 0 || hist_data == nullptr) {
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment