fn

concat

Tensor
concat(tensors: list[Tensor], dim: int = ...)
source

Alias for cat.

Concatenates a list of tensors along an existing dimension. Provided for naming parity with array libraries that prefer the longer name.

Parameters

tensorslist of Tensor
Tensors to concatenate.
dimint= ...
Concatenation dimension.

Returns

Tensor

The concatenated tensor.

Notes

Behaviour is identical to cat — see that function for the precise contract and edge cases.

Examples

>>> import lucid
>>> lucid.concat([lucid.tensor([1, 2]), lucid.tensor([3, 4])], dim=0)
Tensor([1, 2, 3, 4])