megengine.functional.tile¶
- tile(inp, reps)[source]¶
Construct an array by repeating
inp
the number of times given byreps
. If reps has length d, the result will have dimension ofmax(d, inp.ndim)
. It is required thatd >= inp.dim
. Ifinp.ndim < d
,inp
is promoted to bed
-dimensional by prepending new axis.- Parameters
- Returns
output tensor.
Examples
>>> import numpy as np >>> x = Tensor([[1, 2], [3, 4]], np.int32) >>> F.tile(x, (2,1)) Tensor([[1 2] [3 4] [1 2] [3 4]], dtype=int32, device=xpux:0)