latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.hstack
- tensorplay.functional.hstack(tensors, *, out=None) Tensor[source]
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.
- Parameters:
tensors (sequence of Tensors) – sequence of tensors to concatenate
- Keyword Arguments:
out (Tensor, optional) – the output tensor.
Example:
>>> a = tensorplay.tensor([1, 2, 3]) >>> b = tensorplay.tensor([4, 5, 6]) >>> tensorplay.hstack((a,b)) tensor([1, 2, 3, 4, 5, 6]) >>> a = tensorplay.tensor([[1],[2],[3]]) >>> b = tensorplay.tensor([[4],[5],[6]]) >>> tensorplay.hstack((a,b)) tensor([[1, 4], [2, 5], [3, 6]])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

