Skip to content

Commit

Permalink
Fix empty weight.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jul 6, 2021
1 parent 0e2d5f8 commit ba3b228
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/quantile.cc
Expand Up @@ -120,6 +120,10 @@ std::vector<float> MergeWeights(MetaInfo const &info,

std::vector<float> UnrollGroupWeights(MetaInfo const &info) {
std::vector<float> const &group_weights = info.weights_.HostVector();
if (group_weights.empty()) {
return group_weights;
}

size_t n_samples = info.num_row_;
auto const &group_ptr = info.group_ptr_;
std::vector<float> results(n_samples);
Expand Down

0 comments on commit ba3b228

Please sign in to comment.