fn
row_stack
→Tensorrow_stack(tensors: Sequence[Tensor])Stack tensors as rows — alias of lucid.vstack.
Verbose name provided for API parity. Each 1-D input is treated as a row and concatenated along axis 0.
Parameters
tensorsSequence[Tensor]Tensors to stack. 1-D tensors are promoted to
(1, N) row
vectors; higher-rank tensors must have matching column count.Returns
TensorTensor formed by concatenating the (possibly promoted) inputs along axis 0.
Notes
For all-1-D inputs of length N, the result has shape (k, N):
The 1-D-to-2-D promotion is the inverse of column_stack's
promotion.
Examples
>>> import lucid
>>> a = lucid.tensor([1., 2., 3.])
>>> b = lucid.tensor([4., 5., 6.])
>>> lucid.row_stack([a, b])
Tensor([[1., 2., 3.],
[4., 5., 6.]])