View source: R/gen-namespace.R
torch_channel_shuffle | R Documentation |
Channel_shuffle
torch_channel_shuffle(self, groups)
self |
(Tensor) the input tensor |
groups |
(int) number of groups to divide channels in and rearrange. |
math:(*, C , H, W)
:
Divide the channels in a tensor of shape (*, C , H, W)
into g groups and rearrange them as (*, C \frac g, g, H, W)
,
while keeping the original tensor shape.
if (torch_is_installed()) {
input <- torch_randn(c(1, 4, 2, 2))
print(input)
output <- torch_channel_shuffle(input, 2)
print(output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.