diff --git a/paddle/pten/core/dense_tensor_impl.cc b/paddle/pten/core/dense_tensor_impl.cc index 18702c85b08dabb8dd4d2c39e1835695504f1102..80c66c057158b81f3337fd334a560dc4347f4f35 100644 --- a/paddle/pten/core/dense_tensor_impl.cc +++ b/paddle/pten/core/dense_tensor_impl.cc @@ -85,7 +85,8 @@ void DenseTensor::ResetHolder(const std::shared_ptr& 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(SizeOf(dtype())) + meta_.offset, + numel() * static_cast(SizeOf(dtype())) + + static_cast(meta_.offset), static_cast(holder->size()), paddle::platform::errors::InvalidArgument( "The size of Holder is not enough to store the Tensor."));