捷徑

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

參數
  • input (Tensor) – 輸入張量

  • 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 的完整開發者文件

檢視文件

教學課程

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

檢視教學課程

資源

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

檢視資源