ChannelShuffle

class dragon.vm.torch.nn.ChannelShuffle(groups)[source]

Apply group shuffle to each channel. [Zhang et.al, 2017].

Examples:

m = torch.nn.ChannelShuffle(2)
x = torch.tensor([1, 2, 3, 4])
print(m(x))  # [1, 3, 2, 4]

__init__

ChannelShuffle.__init__(groups)[source]

Create a ChannelShuffle module.

Parameters:
  • groups (int) – The number of shuffle groups.