• 文档 >
  • torch >
  • torch.permute
快捷键

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])

© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源