join_tensors | R Documentation |
Join Multiple Tensors into One Tensor
join_tensors(tensors, temporary = TRUE)
tensors |
list of |
temporary |
whether to garbage collect space when exiting R session |
Merges multiple tensors. Each tensor must share the same dimension
with the last one dimension as 1, for example, 100x100x1
. Join 3
tensors like this will result in a 100x100x3
tensor. This function
is handy when each sub-tensors are generated separately. However, it does no
validation test. Use with cautions.
A new Tensor
instance with the last dimension
Zhengjia Wang
tensor1 <- Tensor$new(data = 1:9, c(3,3,1), dimnames = list(
A = 1:3, B = 1:3, C = 1
), varnames = c('A', 'B', 'C'))
tensor2 <- Tensor$new(data = 10:18, c(3,3,1), dimnames = list(
A = 1:3, B = 1:3, C = 2
), varnames = c('A', 'B', 'C'))
merged <- join_tensors(list(tensor1, tensor2))
merged$get_data()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.