channel_shuffle

dragon.channel_shuffle(
  inputs,
  axis=- 1,
  group=1,
  **kwargs
)[source]

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

Examples:

x = dragon.constant([1, 2, 3, 4])
print(dragon.channel_shuffle(x, group=2))  # [1, 3, 2, 4]
Parameters:
  • inputs (dragon.Tensor) – The inputs.
  • axis (int, optional, default=-1) – The channel axis.
  • group (int, optional, default=1) – The number of shuffle groups.
Returns:

dragon.Tensor – The output tensor.