PixelUnshuffle

class dragon.vm.torch.nn.PixelUnshuffle(
  downscale_factor,
  inplace=False
)[source]

Rearrange pixels into depth elements.

Examples:

m = torch.nn.PixelUnshuffle(2)
x = torch.arange(1 * 3 * 2 * 2).reshape((1, 3, 2, 2))
print(m(x).size())  # [1, 12, 1, 1]

__init__

PixelUnshuffle.__init__(
  downscale_factor,
  inplace=False
)[source]

Create a PixelUnshuffle module.

Parameters:
  • downscale_factor (int) – The factor to downscale pixels.
  • inplace (bool, optional, default=False) – Whether to do the operation in-place.