PixelUnshuffle¶
- class torch.nn.PixelUnshuffle(downscale_factor)[源代码][源代码]¶
反转 PixelShuffle 操作。
通过重新排列形状为 的张量中的元素,反转
PixelShuffle
操作,得到形状为 的张量,其中 r 是下采样因子。参见论文:Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network,作者 Shi 等人 (2016),了解更多详情。
- 参数
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])