PixelUnshuffle¶
- class torch.nn.PixelUnshuffle(downscale_factor)[source][source]¶
反轉 PixelShuffle 操作。
透過重新排列形狀為 的張量中的元素,將
PixelShuffle操作反轉為形狀為 的張量,其中 r 是一個下采樣因子。更多詳情請參見 Shi 等人 (2016) 的論文:使用高效亞畫素卷積神經網路的即時單影像和影片超解析度 (Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network)。
- 引數
downscale_factor (int) – 降低空間解析度的因子
- 形狀
輸入: ,其中 * 表示零個或多個批處理維度
輸出:
示例
>>> pixel_unshuffle = nn.PixelUnshuffle(3) >>> input = torch.randn(1, 1, 12, 12) >>> output = pixel_unshuffle(input) >>> print(output.size()) torch.Size([1, 9, 4, 4])