torch_hstack: Hstack

Description Usage Arguments hstack(tensors, *, out=None) -> Tensor Examples

View source: R/gen-namespace.R

Description

Hstack

Usage

1
torch_hstack(tensors)

Arguments

tensors

(sequence of Tensors) sequence of tensors to concatenate

hstack(tensors, *, out=None) -> Tensor

Stack tensors in sequence horizontally (column wise).

This is equivalent to concatenation along the first axis for 1-D tensors, and along the second axis for all other tensors.

Examples

1
2
3
4
5
6
7
8
9
if (torch_is_installed()) {

a <- torch_tensor(c(1, 2, 3))
b <- torch_tensor(c(4, 5, 6))
torch_hstack(list(a,b))
a <- torch_tensor(rbind(1,2,3))
b <- torch_tensor(rbind(4,5,6))
torch_hstack(list(a,b))
}

torch documentation built on Oct. 7, 2021, 9:22 a.m.