Add predictor to skl constructor. (#7000)

This commit is contained in:
Jiaming Yuan
2021-05-29 04:52:56 +08:00
committed by GitHub
parent 55b823b27d
commit 816b789bf0
3 changed files with 12 additions and 2 deletions

View File

@@ -803,7 +803,11 @@ class Dart : public GBTree {
bool success = predictor->InplacePredict(x, nullptr, model_, missing,
&predts, i, i + 1);
device = predts.predictions.DeviceIdx();
CHECK(success) << msg;
CHECK(success) << msg << std::endl
<< "Current Predictor: "
<< (tparam_.predictor == PredictorType::kCPUPredictor
? "cpu_predictor"
: "gpu_predictor");
}
auto w = this->weight_drop_.at(i);

View File

@@ -291,7 +291,11 @@ class GBTree : public GradientBooster {
} else {
bool success = this->GetPredictor()->InplacePredict(
x, p_m, model_, missing, out_preds, tree_begin, tree_end);
CHECK(success) << msg;
CHECK(success) << msg << std::endl
<< "Current Predictor: "
<< (tparam_.predictor == PredictorType::kCPUPredictor
? "cpu_predictor"
: "gpu_predictor");
}
}