Skip to content

Commit

Permalink
check.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Feb 12, 2022
1 parent 3bf3cb5 commit 07bd80b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/metric/elementwise_metric.cu
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ struct EvalEWiseBase : public Metric {
CHECK_EQ(preds.Size(), info.labels.Size())
<< "label and prediction size not match, "
<< "hint: use merror or mlogloss for multi-class classification";
CHECK_NE(info.labels.Shape(1), 0);
if (info.labels.Size() != 0) {
CHECK_NE(info.labels.Shape(1), 0);
}
auto labels = info.labels.View(tparam_->gpu_id);
info.weights_.SetDevice(tparam_->gpu_id);
common::OptionalWeights weights(tparam_->IsCPU() ? info.weights_.ConstHostSpan()
Expand Down

0 comments on commit 07bd80b

Please sign in to comment.