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,.,.) =
#> 1.2647 -0.6131
#> -0.9159 0.5732
#>
#> (1,2,.,.) =
#> 1.0948 -0.7870
#> -1.8078 -0.0688
#>
#> (1,3,.,.) =
#> -0.4148 -0.2391
#> -0.6839 -1.0318
#>
#> (1,4,.,.) =
#> -0.0844 -0.1575
#> 0.1586 -0.1377
#> [ CPUFloatType{1,4,2,2} ]
#> torch_tensor
#> (1,1,.,.) =
#> 1.2647 -0.6131
#> -0.9159 0.5732
#>
#> (1,2,.,.) =
#> -0.4148 -0.2391
#> -0.6839 -1.0318
#>
#> (1,3,.,.) =
#> 1.0948 -0.7870
#> -1.8078 -0.0688
#>
#> (1,4,.,.) =
#> -0.0844 -0.1575
#> 0.1586 -0.1377
#> [ CPUFloatType{1,4,2,2} ]