Commit 5c0afab2 authored by Tony-Y's avatar Tony-Y Committed by Qiwei Ye
Browse files

Fix typos in c_api.cpp (#983)

* Bounds checking of used_row_indices (#959)

* add Common::check_int32_elements_interval_closed function.

* insert a bounds checking code in LGBM_DatasetGetSubset function of C API.

* Delete a needless function

* delete the function check_int32_elements_interval_closed

* Fix typos
parent 9f952558
...@@ -190,19 +190,19 @@ public: ...@@ -190,19 +190,19 @@ public:
Predictor predictor(boosting_.get(), num_iteration, is_raw_score, is_predict_leaf, is_predict_contrib, Predictor predictor(boosting_.get(), num_iteration, is_raw_score, is_predict_leaf, is_predict_contrib,
config.pred_early_stop, config.pred_early_stop_freq, config.pred_early_stop_margin); config.pred_early_stop, config.pred_early_stop_freq, config.pred_early_stop_margin);
int64_t num_preb_in_one_row = boosting_->NumPredictOneRow(num_iteration, is_predict_leaf, is_predict_contrib); int64_t num_pred_in_one_row = boosting_->NumPredictOneRow(num_iteration, is_predict_leaf, is_predict_contrib);
auto pred_fun = predictor.GetPredictFunction(); auto pred_fun = predictor.GetPredictFunction();
OMP_INIT_EX(); OMP_INIT_EX();
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for (int i = 0; i < nrow; ++i) { for (int i = 0; i < nrow; ++i) {
OMP_LOOP_EX_BEGIN(); OMP_LOOP_EX_BEGIN();
auto one_row = get_row_fun(i); auto one_row = get_row_fun(i);
auto pred_wrt_ptr = out_result + static_cast<size_t>(num_preb_in_one_row) * i; auto pred_wrt_ptr = out_result + static_cast<size_t>(num_pred_in_one_row) * i;
pred_fun(one_row, pred_wrt_ptr); pred_fun(one_row, pred_wrt_ptr);
OMP_LOOP_EX_END(); OMP_LOOP_EX_END();
} }
OMP_THROW_EX(); OMP_THROW_EX();
*out_len = nrow * num_preb_in_one_row; *out_len = nrow * num_pred_in_one_row;
} }
void Predict(int num_iteration, int predict_type, const char* data_filename, void Predict(int num_iteration, int predict_type, const char* data_filename,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment