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