Creates a slice object that can be used when indexing torch tensors.
Examples
if (torch_is_installed()) {
x <- torch_randn(10)
x[slc(start = 1, end = 5, step = 2)]
}
#> torch_tensor
#> -0.5247
#> -0.3619
#> 0.1482
#> [ CPUFloatType{3} ]
Creates a slice object that can be used when indexing torch tensors.
if (torch_is_installed()) {
x <- torch_randn(10)
x[slc(start = 1, end = 5, step = 2)]
}
#> torch_tensor
#> -0.5247
#> -0.3619
#> 0.1482
#> [ CPUFloatType{3} ]