| as.matrix.ag_tensor | R Documentation |
The value of an ag_tensor lives in $data only on the CPU. On
the GPU it lives in a backend buffer and $data stays NULL until
something materialises it, so reading $data directly works on one
device and returns NULL on the other. This method downloads the value
when it has to and returns the same matrix either way – use it rather than
$data in code that may run on a GPU.
## S3 method for class 'ag_tensor'
as.matrix(x, ...)
x |
An |
... |
Ignored |
A numeric matrix holding the tensor's current value.
t <- ag_tensor(matrix(1:6, nrow = 2))
as.matrix(t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.