快捷方式

torch.nn.functional.pixel_unshuffle

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

透過重新排列形狀為 (,C,H×r,W×r)(*, C, H \times r, W \times r) 的 Tensor 元素,將其反轉為形狀為 (,C×r2,H,W)(*, C \times r^2, H, W) 的 Tensor,該操作是 PixelShuffle 操作的逆向過程,其中 r 是 downscale_factor

詳情請參閱 PixelUnshuffle

引數
  • input (Tensor) – 輸入 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])

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源