Removed unnecessary PredictBatch calls (#6700)

Co-authored-by: Shvets Kirill <kirill.shvets@intel.com>
This commit is contained in:
ShvetsKS 2021-02-10 15:15:14 +03:00 committed by GitHub
parent 9b267a435e
commit 9a0399e898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,7 +470,9 @@ void GBTree::PredictBatch(DMatrix* p_fmat,
uint32_t tree_begin, tree_end;
std::tie(tree_begin, tree_end) =
detail::LayerToTree(model_, tparam_, layer_begin, layer_end);
predictor->PredictBatch(p_fmat, out_preds, model_, tree_begin, tree_end);
if (tree_end > tree_begin) {
predictor->PredictBatch(p_fmat, out_preds, model_, tree_begin, tree_end);
}
if (reset) {
out_preds->version = 0;
} else {