as.array.tensor | R Documentation |
Converts a tensor()
to an array()
by stripping the index labels.
An index label order
needs to be provided so that the array's dim()
order is well defined.
## S3 method for class 'tensor'
as.array(
x,
index_order = NULL,
...,
arg = "index_order",
call = rlang::caller_env()
)
x |
A labeled array ("tensor" object) created by |
index_order |
An index specification created with |
... |
Not used. |
arg , call |
Used for error handling. Can be ignored by the user. |
The tensor components as usual array()
object without any index labels
attached.
array(1:8, dim = c(2, 2, 2)) %_% .(i, +i, k) |> as.array(.(k))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.