捷徑

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

文件

存取 PyTorch 的完整開發人員文件

檢視文件

教學

取得針對初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並取得問題解答

檢視資源