快捷键

torch.nn.functional.pixel_shuffle

torch.nn.functional.pixel_shuffle(input, upscale_factor) Tensor

将形状为 (,C×r2,H,W)(*, C \times r^2, H, W) 的张量元素重新排列为形状为 (,C,H×r,W×r)(*, C, H \times r, W \times r) 的张量,其中 r 是 upscale_factor

详细内容请见 PixelShuffle

参数:
  • 输入(张量)- 输入张量

  • upscale_factor (int) – 用于增加空间分辨率的因子

示例:

>>> input = torch.randn(1, 9, 4, 4)
>>> output = torch.nn.functional.pixel_shuffle(input, 3)
>>> print(output.size())
torch.Size([1, 1, 12, 12])

© 版权所有 PyTorch 贡献者。

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

文档

PyTorch 的全面开发者文档

查看文档

教程

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

查看教程

资源

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

查看资源