fn

tile

Tensor
tile(input: Tensor, reps: Sequence[int])
source

Construct a tensor by repeating input reps times per axis.

Unlike repeat (single axis), tile accepts a per-axis repetition vector. If len(reps) < input.ndim it is padded on the left with 1's; if greater, input is treated as having leading size-1 dims.

Parameters

inputTensor
Source tensor.
repssequence of int
Repetition counts per axis (right-aligned with input shape).

Returns

Tensor

Tiled tensor.

Notes

Equivalent to repeated cat calls along each axis; useful for building blocky patterns or batch broadcasts that need a real copy rather than a stride-0 view.

Examples

>>> import lucid
>>> x = lucid.tensor([1, 2, 3])
>>> lucid.tile(x, (2,))
Tensor([1, 2, 3, 1, 2, 3])