未验证 提交 f7a3389e 编写于 作者: Z zyfncg 提交者: GitHub

fix check error of ResetHolder (#39439)

上级 238f3c8e
......@@ -85,7 +85,8 @@ void DenseTensor::ResetHolder(const std::shared_ptr<pten::Allocation>& holder) {
// compare with a data with unsigned long type, this will make checking
// failed, so it's a temporary solution to deal with this problem.
PADDLE_ENFORCE_LE(
numel() * static_cast<int64_t>(SizeOf(dtype())) + meta_.offset,
numel() * static_cast<int64_t>(SizeOf(dtype())) +
static_cast<int64_t>(meta_.offset),
static_cast<int64_t>(holder->size()),
paddle::platform::errors::InvalidArgument(
"The size of Holder is not enough to store the Tensor."));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册