torch.permute¶ torch.permute(input, dims) → Tensor¶ 傳回原始張量 input 的視圖,其維度已重新排列。 參數 input ( Tensor ) – 輸入張量 (input tensor)。 dims ( tuple of int ) – 維度的期望順序 (The desired ordering of dimensions)。 範例 (Example) >>> 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])