# NOT RUN {
x <- torch$arange(1L, 10L)
opts <- torch_extract_opts("R")
x[1, options = opts]
# or for more fine-grained control
opts <- torch_extract_opts(
one_based = FALSE,
warn_tensors_passed_asis = FALSE,
warn_negatives_pythonic = FALSE
)
x[0:2, options = opts]
# }
Run the code above in your browser using DataLab