.r_to_torch {mafR} | R Documentation |
(Currently not used nor exported) utility converting an R object to a torch tensor.
.r_to_torch(x, py_handle, device)
x |
An R object suitable for use in |
py_handle |
The return value of |
device |
Character: |
r_to_torch
returns a 32-bit floating-point torch tensor allocated on the given device
.
my_env <- list2env(list(is_set=FALSE),parent = emptyenv())
my_env <- get_py_MAF_handle(my_env, reset=FALSE, torch_device="cpu")