[Pytorch] Torch.permute() 차원을 변경하는 함수 / Transpose 함수와의 차이점
torch.permute — PyTorch 2.1 documentation Shortcuts pytorch.org 공식 문서는 위의 링크를 참고하시면 됩니다. 간단하게 설명하자면 차원의 위치를 변경해주는 함수입니다. Permute() # z.shape = (batch, channel, height, width) z = z.permute(0, 2, 3, 1).contiguous() # z.shape -> (batch, height, width, channel) z_flattened = z.view(-1, self.e_dim) Parameters input (Tensor) – the input tensor. dims (tuple of int) – The desired ordering of dimensions..
2023. 12. 17.