PixelUnshuffle
- class torch.nn.PixelUnshuffle(downscale_factor)
Reverse the PixelShuffle operation.
Reverses the
PixelShuffleoperation by rearranging elements in a tensor of shape to a tensor of shape , where r is a downscale factor.
Reverse the PixelShuffle operation.
Reverses the PixelShuffle operation by rearranging elements
in a tensor of shape to a tensor of shape
, where r is a downscale factor.
See the paper: Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network by Shi et al. (2016) for more details.
downscale_factor (int) – factor to decrease spatial resolution by
Input: , where * is zero or more batch dimensions
Output: , where
Examples:
>>> 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])
Return the extra representation of the module.
Runs the forward pass.