Skip to content
fn

hstack_op

→TensorImplPtr
int hstack_op(const int & xs)

Python wrappers

Public Python APIs implemented by this engine symbol.

Horizontally stack a sequence of tensors.

Equivalent to NumPy hstack: for 1-D inputs the result concatenates along axis 0; for tensors with rank >= 2 the concatenation occurs along axis 1. Tensors must agree on every non-horizontal dimension.

See Also

vstack_op, concatenate_op.

Parameters

xsvector<TensorImplPtr>
Non-empty list of tensors with the same rank, dtype, and device.

Returns

TensorImplPtr

Horizontally concatenated tensor.

Examples

1-D inputs ``[a, b, c]`` and ``[d, e]`` produce ``[a, b, c, d, e]``.
2-D inputs of shapes ``(R, C_i)`` produce shape ``(R, \sum_i C_i)``.