It creates a tensor without taking ownership of the memory it points to.
You must call clone
if you want to copy the memory over a new tensor.
torch_tensor_from_buffer(buffer, shape, dtype = "float")buffer_from_torch_tensor(tensor)
An R atomic object containing the data in a contiguous array.
The shape of the resulting tensor.
A torch data type for the tresulting tensor.
Tensor object that will be converted into a buffer.
buffer_from_torch_tensor()
: Creates a raw vector containing the tensor data. Causes a data copy.