mindspore.ops.channel_shuffle
- mindspore.ops.channel_shuffle(x, groups)[source]
- Divide the channels in a tensor of shape \((*, C, H, W)\) into \(g\) groups and rearrange them as \((*, \frac{C}{g}, g, H*W)\), while retaining the original tensor shape in the final output. - Parameters
- Returns
- Tensor 
 - Supported Platforms:
- Ascend- CPU
 - Examples - >>> import mindspore >>> x = mindspore.tensor(mindspore.ops.arange(0, 16, dtype=mindspore.int16).reshape(1, 4, 2, 2)) >>> y = mindspore.ops.channel_shuffle(x, groups=2) >>> print(y) [[[[ 0 1] [ 2 3]] [[ 8 9] [10 11]] [[ 4 5] [ 6 7]] [[12 13] [14 15]]]]