fn
cat
→Tensorcat(tensors: list[Tensor], dim: DimLike = ...)Concatenate tensors along an existing dimension.
All tensors must share the same shape except along dim. The
output dimensionality is unchanged; only the size of dim grows.
Contrast with stack, which inserts a new leading dim.
Parameters
tensorslist of TensorTensors to concatenate. Must be non-empty.
dimDimLike= ...The dimension along which to concatenate.
Returns
TensorA newly-allocated tensor — concatenation always copies.
Notes
Mathematically, if are the inputs, the result is
Examples
>>> import lucid
>>> a = lucid.tensor([[1, 2]])
>>> b = lucid.tensor([[3, 4]])
>>> lucid.cat([a, b], dim=0)
Tensor([[1, 2],
[3, 4]])