o

    hy                     @   s   d dl Z dd ZdS )    Nc                 C   sd   |   \}}}}|| dksJ d|| }| |||||} t| dd } | |d||} | S )aq  Channel Shuffle operation.

    This function enables cross-group information flow for multiple groups
    convolution layers.

    Args:
        x (Tensor): The input tensor.
        groups (int): The number of groups to divide the input tensor
            in the channel dimension.

    Returns:
        Tensor: The output tensor after channel shuffle operation.
    r   z*num_channels should be divisible by groups      )sizeviewtorch	transpose
contiguous)xgroups
batch_sizenum_channelsheightwidthchannels_per_group r   9/root/Awesome-Backbones/configs/common/channel_shuffle.pychannel_shuffle   s   r   )r   r   r   r   r   r   <module>   s   