评价此页

torch.nn.functional.pixel_unshuffle#

torch.nn.functional.pixel_unshuffle(input, downscale_factor) Tensor#

执行 PixelShuffle 操作的逆操作,将形状为 (,C,H×r,W×r)(*, C, H \times r, W \times r) 的张量重新排列为形状为 (,C×r2,H,W)(*, C \times r^2, H, W) 的张量,其中 r 是 downscale_factor

详情请参阅 PixelUnshuffle

参数
  • input (Tensor) – 输入张量

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

示例

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