Skip to content

Commit ea1665a

Browse files
authored
ResizeAndAllocate API fix place release bug (#72587)
1 parent 1943d97 commit ea1665a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/phi/core/dense_tensor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ void DenseTensor::ResizeAndAllocate(const DDim& dims) {
251251
meta_.strides = meta_.calc_strides(meta_.dims);
252252

253253
if (holder_ != nullptr && place().GetType() != AllocationType::UNDEFINED) {
254-
mutable_data(place());
254+
const Place current_place(place());
255+
mutable_data(current_place);
255256
}
256257
}
257258

0 commit comments

Comments
 (0)