Skip to content

Commit

Permalink
Fix typos in c_api.cpp (#983)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Tony-Y authored and chivee committed Oct 11, 2017
1 parent 9f95255 commit 5c0afab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,19 @@ class Booster {

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);
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();
OMP_INIT_EX();
#pragma omp parallel for schedule(static)
for (int i = 0; i < nrow; ++i) {
OMP_LOOP_EX_BEGIN();
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);
OMP_LOOP_EX_END();
}
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,
Expand Down

0 comments on commit 5c0afab

Please sign in to comment.