Skip to content

Commit 488b87c

Browse files
malfetpytorchmergebot
authored andcommitted
[BE] do not retain/release tensor (pytorch#150075)
`Tensor::as_strided__symint` is inplace op that returns self, no need to retain it Pull Request resolved: pytorch#150075 Approved by: https://github.com/angelayi, https://github.com/atalman, https://github.com/cyyever
1 parent 1f92348 commit 488b87c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aten/src/ATen/native/TensorShape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3614,7 +3614,7 @@ Tensor& transpose_(Tensor& self, int64_t dim0, int64_t dim1) {
36143614
std::swap(sizes[dim0], sizes[dim1]);
36153615
SymDimVector strides(self.sym_strides().begin(), self.sym_strides().end());
36163616
std::swap(strides[dim0], strides[dim1]);
3617-
auto result = self.as_strided__symint(std::move(sizes), std::move(strides));
3617+
self.as_strided__symint(std::move(sizes), std::move(strides));
36183618
return self;
36193619
}
36203620

0 commit comments

Comments
 (0)