评价此页

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