Fix overflow in prediction size. (#7885)

This commit is contained in:
Jiaming Yuan
2022-05-12 02:44:03 +08:00
committed by GitHub
parent 8ba4722d04
commit 94ca52b7b7
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);
}