Skip to content

Commit

Permalink
restore checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Dec 20, 2022
1 parent 8bc44fa commit 2dcc11a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion demo/guide-python/multioutput_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ def rmse(predt: np.ndarray, dtrain: xgb.DMatrix) -> Tuple[str, float]:
# automatically.
booster = xgb.train(
{
"tree_method": "mt_hist",
"tree_method": "hist",
"num_target": y.shape[1],
"multi_strategy": "mono",
},
dtrain=Xy,
num_boost_round=100,
Expand Down
2 changes: 1 addition & 1 deletion src/gbm/gbtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void GBTree::PredictBatch(DMatrix* p_fmat,

std::uint32_t tree_begin, tree_end;
std::tie(tree_begin, tree_end) = detail::LayerToTree(model_, layer_begin, layer_end);
// CHECK_LE(tree_end, model_.trees.size()) << "Invalid number of trees.";
CHECK_LE(tree_end, model_.trees.size()) << "Invalid number of trees.";
if (tree_end > tree_begin) {
predictor->PredictBatch(p_fmat, out_preds, model_, tree_begin, tree_end);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gbm/gbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class GBTree : public GradientBooster {
CHECK(configured_);
uint32_t tree_begin, tree_end;
std::tie(tree_begin, tree_end) = detail::LayerToTree(model_, layer_begin, layer_end);
// CHECK_LE(tree_end, model_.trees.size()) << "Invalid number of trees.";
CHECK_LE(tree_end, model_.trees.size()) << "Invalid number of trees.";
std::vector<Predictor const *> predictors{
cpu_predictor_.get(),
#if defined(XGBOOST_USE_CUDA)
Expand Down

0 comments on commit 2dcc11a

Please sign in to comment.