powered by
Reshape an array to send a dimension forward or back
set_as_rows(X, which_dim)set_as_cols(X, which_dim)
set_as_cols(X, which_dim)
an array
scalar integer or string, which dim to bring forward. Negative numbers count from the back
This is a powered by base::aperm().
base::aperm()
a reshaped array
base::aperm() set_dim() keras::array_reshape()
set_dim()
keras::array_reshape()
# NOT RUN { x <- array(1:24, 2:4) y <- set_as_rows(x, 3) for (i in seq_along_dim(x, 3)) stopifnot( identical(x[,,i], y[i,,]) ) # }
Run the code above in your browser using DataLab