Channel_shuffle
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_channel_shuffle.Rd
Channel_shuffle
Divide the channels in a tensor of shape
math:(*, C , H, W)
:
Divide the channels in a tensor of shape
Examples
if (torch_is_installed()) {
input <- torch_randn(c(1, 4, 2, 2))
print(input)
output <- torch_channel_shuffle(input, 2)
print(output)
}
#> torch_tensor
#> (1,1,.,.) =
#> 3.0396 -0.4883
#> 0.2065 -0.0433
#>
#> (1,2,.,.) =
#> 1.6674 0.4861
#> 0.4390 0.3384
#>
#> (1,3,.,.) =
#> -1.5326 0.3339
#> 1.0767 -0.7138
#>
#> (1,4,.,.) =
#> -0.0964 0.0504
#> 1.4690 1.5594
#> [ CPUFloatType{1,4,2,2} ]
#> torch_tensor
#> (1,1,.,.) =
#> 3.0396 -0.4883
#> 0.2065 -0.0433
#>
#> (1,2,.,.) =
#> -1.5326 0.3339
#> 1.0767 -0.7138
#>
#> (1,3,.,.) =
#> 1.6674 0.4861
#> 0.4390 0.3384
#>
#> (1,4,.,.) =
#> -0.0964 0.0504
#> 1.4690 1.5594
#> [ CPUFloatType{1,4,2,2} ]