torch.permute¶ torch.permute(input, dims) → Tensor¶ 返回原始张量 input 的一个视图,其维度已重新排列。 参数: input (Tensor) – 输入张量。 dims (tuple of python:int) – The desired ordering of dimensions 示例 >>> x = torch.randn(2, 3, 5) >>> x.size() torch.Size([2, 3, 5]) >>> torch.permute(x, (2, 0, 1)).size() torch.Size([5, 2, 3])