Skip to content

Commit efb83ea

Browse files
committed
Fix test.
1 parent e937028 commit efb83ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/learner.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,13 +1160,13 @@ class LearnerImpl : public LearnerIO {
11601160
}
11611161

11621162
this->ValidateDMatrix(train.get(), true);
1163-
1164-
CHECK_GE(this->learner_model_param_.OutputLength(), in_gpair->NumSplitTargets())
1165-
<< "The number of columns in gradient should be equal to or lesser than the number of "
1166-
"targets/classes in the model.";
11671163
if (in_gpair->HasValueGrad()) {
11681164
CHECK_EQ(this->learner_model_param_.OutputLength(), in_gpair->NumTargets())
11691165
<< "Value gradient should have the same number of targets as the overall model.";
1166+
} else {
1167+
CHECK_EQ(this->learner_model_param_.OutputLength(), in_gpair->NumSplitTargets())
1168+
<< "The number of columns in gradient should be equal to the number of "
1169+
"targets/classes in the model.";
11701170
}
11711171
auto predt = prediction_container_.Cache(train, ctx_.Device());
11721172
this->gbm_->DoBoost(train.get(), in_gpair, predt.get(), obj_.get());

0 commit comments

Comments
 (0)