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.5218
#> -0.7995
#> 1.1375
#> [ 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.5218
#> -0.7995
#> 1.1375
#> [ CPUFloatType{3} ]