/usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/torch/nn/modules/__pycache__/channelshuffle.cpython-36.pyc (1901B)
3
ûEg ã @ s8 d dl mZ ddlmZ ddlmZ G dd„ deƒZdS ) é )ÚModuleé )Ú
functionalé )ÚTensorc sR e Zd ZU dZdgZeeddœ‡ fdd„Zeedœdd „Z e
d
œdd„Z‡ ZS )
ÚChannelShufflea/ 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::
>>> 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 t| ƒjƒ || _d S )N)Úsuperr Ú__init__r )Úselfr )Ú __class__© úK/usr/local/lib64/python3.6/site-packages/torch/nn/modules/channelshuffle.pyr , s zChannelShuffle.__init__)Úinputr c C s t j|| jƒS )N)ÚFZchannel_shuffler )r r r r r Úforward0 s zChannelShuffle.forward)r c C s dj | jƒS )Nz groups={})Úformatr )r r r r Ú
extra_repr3 s zChannelShuffle.extra_repr)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Z
__constants__Úintr r r r Ústrr Ú
__classcell__r r )r
r r s
!r N)Úmoduler Ú r r Ztorchr r r r r r Ú
s