diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc index f9a9bc15e..f7586c192 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -734,8 +734,9 @@ XGB_DLL int XGBoosterPredictFromCSR(BoosterHandle handle, char const *indptr, API_BEGIN(); CHECK_HANDLE(); std::shared_ptr x{ - new xgboost::data::CSRArrayAdapter{ - StringView{indptr}, StringView{indices}, StringView{data}, cols}}; + new xgboost::data::CSRArrayAdapter{StringView{indptr}, + StringView{indices}, StringView{data}, + static_cast(cols)}}; std::shared_ptr p_m {nullptr}; if (m) { p_m = *static_cast *>(m); diff --git a/src/gbm/gbtree.cc b/src/gbm/gbtree.cc index 50d5b963b..5c8299c83 100644 --- a/src/gbm/gbtree.cc +++ b/src/gbm/gbtree.cc @@ -231,7 +231,7 @@ void GBTree::DoBoost(DMatrix* p_fmat, : in_gpair->DeviceIdx(); auto out = MatrixView( &predt->predictions, - {p_fmat->Info().num_row_, static_cast(ngroup)}, device); + {static_cast(p_fmat->Info().num_row_), static_cast(ngroup)}, device); CHECK_NE(ngroup, 0); if (ngroup == 1) { std::vector> ret;