Fix overflow in prediction size. (#7885) (#7980)

This commit is contained in:
Jiaming Yuan
2022-06-07 12:30:41 +08:00
committed by GitHub
parent 645855e8b1
commit b7c3fc9182
2 changed files with 4 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ inline void CalcPredictShape(bool strict_shape, PredictionType type, size_t rows
}
}
CHECK_EQ(
std::accumulate(shape.cbegin(), shape.cend(), 1, std::multiplies<>{}),
std::accumulate(shape.cbegin(), shape.cend(), static_cast<bst_ulong>(1), std::multiplies<>{}),
chunksize * rows);
}