Skip to content

Commit 39ec9bf

Browse files
committed
fix check error of ResetHolder
1 parent 2a5d858 commit 39ec9bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/pten/core/dense_tensor_impl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ void DenseTensor::ResetHolder(const std::shared_ptr<pten::Allocation>& holder) {
8585
// compare with a data with unsigned long type, this will make checking
8686
// failed, so it's a temporary solution to deal with this problem.
8787
PADDLE_ENFORCE_LE(
88-
numel() * static_cast<int64_t>(SizeOf(dtype())) + meta_.offset,
88+
numel() * static_cast<int64_t>(SizeOf(dtype())) +
89+
static_cast<int64_t>(meta_.offset),
8990
static_cast<int64_t>(holder->size()),
9091
paddle::platform::errors::InvalidArgument(
9192
"The size of Holder is not enough to store the Tensor."));

0 commit comments

Comments
 (0)