torch.permute¶ torch.permute(input, dims) → Tensor¶ 返回原始張量 input 的一個檢視,其維度已進行置換。 引數 input (Tensor) – 輸入張量。 dims (int 元組) – 期望的維度順序 示例 >>> 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])