torch.transpose — PyTorch 1.10.1 documentation
pytorch.org › generated › torchtorch.transpose. torch.transpose(input, dim0, dim1) → Tensor. Returns a tensor that is a transposed version of input . The given dimensions dim0 and dim1 are swapped. The resulting out tensor shares its underlying storage with the input tensor, so changing the content of one would change the content of the other.
[ux] Proposal to have t() === transpose(-1, -2), since ...
github.com › pytorch › pytorchJan 28, 2021 · In PyTorch usecases we almost always work with batches of matrices, and the convenience method t() breaks because it wants <= 2 dimensions. Since this is so common, I propose to relax constraints of t() and make it equivalent to transpose(-1, -2) for all input shapes. This could have been discussed and decided before, but I could not find the ...