tile¶
- tile(x: array, repetitions: Tuple[int, ...], /) array¶
Constructs an array by tiling an input array.
- Parameters:
x (array) – input array.
repetitions (Tuple[int, ...]) –
number of repetitions along each axis.
Let
N = len(x.shape)andM = len(repetitions).If
N > M, the function must prepend ones until all axes are specified (e.g., ifxhas shape(8,6,4,2)andrepetitionsis the tuple(3,3), thenrepetitionsmust be treated as(1,1,3,3)).If
N < M, the function must prepend singleton axes toxuntilxhas as many axes asrepetitionsspecifies (e.g., ifxhas shape(4,2)andrepetitionsis the tuple(3,3,3,3), thenxmust be treated as if it has shape(1,1,4,2)).
- Returns:
out (array) – a tiled output array. The returned array must have the same data type as
xand must have a number of axes equal tomax(N, M). IfSis the shape of the tiled array after prepending singleton dimensions (if necessary) andris the tuple of repetitions after prepending ones (if necessary), then the number of elements along each axis must satisfyS[i]*r[i], whereirefers to theith axis.
Notes
New in version 2023.12.