Skip to content

Commit

Permalink
Remove workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Mar 16, 2023
1 parent 531967e commit d15f363
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/common/error_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ constexpr StringView LabelScoreSize() {
}

constexpr StringView InfInData() {
return "Input data contains `inf` while `missing` is not set to `inf`";
return "Input data contains `inf` or a value too large, while `missing` is not set to `inf`";
}
} // namespace xgboost::error
#endif // XGBOOST_COMMON_ERROR_MSG_H_
5 changes: 0 additions & 5 deletions src/data/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,6 @@ void MetaInfo::SetInfoFromHost(Context const& ctx, StringView key, Json arr) {
return;
} else if (key == "label") {
CopyTensorInfoImpl(ctx, arr, &this->labels);
if (this->num_row_ != 0 && this->labels.Shape(0) != this->num_row_) {
CHECK_EQ(this->labels.Size() % this->num_row_, 0) << "Incorrect size for labels.";
size_t n_targets = this->labels.Size() / this->num_row_;
this->labels.Reshape(this->num_row_, n_targets);
}
auto const& h_labels = labels.Data()->ConstHostVector();
auto valid = std::none_of(h_labels.cbegin(), h_labels.cend(), data::LabelsCheck{});
CHECK(valid) << "Label contains NaN, infinity or a value too large.";
Expand Down

0 comments on commit d15f363

Please sign in to comment.