@@ -1027,6 +1027,7 @@ XGB_DLL int XGBoosterInplacePredict(BoosterHandle handle,
1027
1027
API_BEGIN ();
1028
1028
CHECK_HANDLE ();
1029
1029
xgboost::bst_ulong out_dim;
1030
+ std::shared_ptr<xgboost::data::DenseAdapter> x{new xgboost::data::DenseAdapter (data, num_rows, num_features)};
1030
1031
// std::shared_ptr<DMatrix> p_m(dMatrixHandle);
1031
1032
std::shared_ptr<DMatrix> p_m{nullptr };
1032
1033
if (!dMatrixHandle) {
@@ -1042,15 +1043,14 @@ XGB_DLL int XGBoosterInplacePredict(BoosterHandle handle,
1042
1043
}
1043
1044
} else {
1044
1045
p_m = *static_cast <std::shared_ptr<DMatrix> *>(dMatrixHandle);
1045
-
1046
1046
fprintf (stdout, " dmatrix handle is not null" );
1047
1047
if (!p_m) {
1048
1048
fprintf (stderr, " p_m 2 is null" );
1049
1049
exit (1 );
1050
1050
}
1051
1051
}
1052
1052
fprintf (stdout, reinterpret_cast <const char *>(p_m.get ()));
1053
- DMatrixProxy* stuff = dynamic_cast <data::DMatrixProxy *>(p_m.get ());
1053
+ // DMatrixProxy* stuff = dynamic_cast<data::DMatrixProxy *>(p_m.get());
1054
1054
auto proxy = new std::shared_ptr<xgboost::DMatrix>(new xgboost::data::DMatrixProxy);
1055
1055
if (!proxy) {
1056
1056
fprintf (stderr, " proxy is null" );
@@ -1062,6 +1062,7 @@ XGB_DLL int XGBoosterInplacePredict(BoosterHandle handle,
1062
1062
}
1063
1063
auto *learner = static_cast <xgboost::Learner *>(handle);
1064
1064
auto iteration_end = GetIterationFromTreeLimit (ntree_limit, learner);
1065
+ proxy->SetDenseData (data)
1065
1066
InplacePredictImplCore (p_m, learner, (xgboost::PredictionType)0 , missing, num_rows, num_features,
1066
1067
0 , iteration_end, true , len, &out_dim, out_result);
1067
1068
// printf("XGBoosterInplacePredict len = %u, dim = %u\n", **len, out_dim);
0 commit comments