U
    *-eN                     @   s>   d dl mZ ddlmZ ddlmZ dgZG dd deZdS )	   )Module   )
functional    )TensorChannelShufflec                       sV   e Zd ZU dZdgZeed< edd fddZeeddd	Z	e
d
ddZ  ZS )r   am  Divide the channels in a tensor of shape :math:`(*, C , H, W)`
    into g groups and rearrange them as :math:`(*, C \frac g, g, H, W)`,
    while keeping the original tensor shape.

    Args:
        groups (int): number of groups to divide channels in.

    Examples::

        >>> # xdoctest: +IGNORE_WANT("FIXME: incorrect want")
        >>> channel_shuffle = nn.ChannelShuffle(2)
        >>> input = torch.randn(1, 4, 2, 2)
        >>> print(input)
        [[[[1, 2],
           [3, 4]],
          [[5, 6],
           [7, 8]],
          [[9, 10],
           [11, 12]],
          [[13, 14],
           [15, 16]],
         ]]
        >>> output = channel_shuffle(input)
        >>> print(output)
        [[[[1, 2],
           [3, 4]],
          [[9, 10],
           [11, 12]],
          [[5, 6],
           [7, 8]],
          [[13, 14],
           [15, 16]],
         ]]
    groupsN)r   returnc                    s   t    || _d S N)super__init__r   )selfr   	__class__ `/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/torch/nn/modules/channelshuffle.pyr   .   s    
zChannelShuffle.__init__)inputr	   c                 C   s   t || jS r
   )FZchannel_shuffler   )r   r   r   r   r   forward2   s    zChannelShuffle.forward)r	   c                 C   s   d| j  S )Nzgroups=)r   )r   r   r   r   
extra_repr5   s    zChannelShuffle.extra_repr)__name__
__module____qualname____doc__Z__constants__int__annotations__r   r   r   strr   __classcell__r   r   r   r   r      s   
"N)	moduler    r   r   Ztorchr   __all__r   r   r   r   r   <module>   s   