
Last chance! 50% off unlimited learning
Sale ends in
Dstack
torch_dstack(tensors)
(sequence of Tensors) sequence of tensors to concatenate
Stack tensors in sequence depthwise (along third axis).
This is equivalent to concatenation along the third axis after 1-D and 2-D
tensors have been reshaped by torch_atleast_3d()
.
# NOT RUN {
if (torch_is_installed()) {
a <- torch_tensor(c(1, 2, 3))
b <- torch_tensor(c(4, 5, 6))
torch_dstack(list(a,b))
a <- torch_tensor(rbind(1,2,3))
b <- torch_tensor(rbind(4,5,6))
torch_dstack(list(a,b))
}
# }
Run the code above in your browser using DataLab