Skip to content

Commit a173763

Browse files
committed
change how proxy is cast in cpu predictor
1 parent 5a08ff8 commit a173763

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/predictor/cpu_predictor.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,8 @@ class CPUPredictor : public Predictor {
396396
bool InplacePredict(std::shared_ptr<DMatrix> p_m, const gbm::GBTreeModel &model, float missing,
397397
PredictionCacheEntry *out_preds, uint32_t tree_begin,
398398
unsigned tree_end) const override {
399-
//auto proxy = dynamic_cast<data::DMatrixProxy *>(p_m.get());
400-
auto proxy = new std::shared_ptr<xgboost::DMatrix>(new xgboost::data::DMatrixProxy);
401-
if (!proxy) {
402-
fprintf (stderr, "InplacePredict: proxy is null cpu variant");
403-
exit(1);
404-
}
399+
auto proxy = dynamic_cast<data::DMatrixProxy *>(p_m.get());
400+
//auto proxy = new std::shared_ptr<xgboost::DMatrix>(new xgboost::data::DMatrixProxy);
405401
auto x = proxy->Adapter();
406402
if (x.type() == typeid(std::shared_ptr<data::DenseAdapter>)) {
407403
this->DispatchedInplacePredict<data::DenseAdapter, kBlockOfRowsSize>(

0 commit comments

Comments
 (0)