Tile#
Tile - 13#
Version
name: Tile (GitHub)
domain: main
since_version: 13
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 13.
Summary
Constructs a tensor by tiling a given tensor. This is the same as function tile in Numpy, but no broadcast. For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]]
Inputs
input (heterogeneous) - T: Input tensor of any shape.
repeats (heterogeneous) - T1: 1D int64 tensor of the same length as input’s dimension number, includes numbers of repeated copies along input’s dimensions.
Outputs
output (heterogeneous) - T: Output tensor of the same dimension and type as tensor input. output_dim[i] = input_dim[i] * repeats[i]
Type Constraints
T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.
T1 in ( tensor(int64) ): Constrain repeat’s type to int64 tensors.
Examples
tile
node = onnx.helper.make_node(
'Tile',
inputs=['x', 'y'],
outputs=['z']
)
x = np.random.rand(2, 3, 4, 5).astype(np.float32)
repeats = np.random.randint(low=1, high=10, size=(np.ndim(x),)).astype(np.int64)
z = np.tile(x, repeats)
expect(node,
inputs=[x, repeats],
outputs=[z],
name='test_tile')
tile_precomputed
node = onnx.helper.make_node(
'Tile',
inputs=['x', 'y'],
outputs=['z']
)
x = np.array([
[0, 1],
[2, 3]
], dtype=np.float32)
repeats = np.array([2, 2], dtype=np.int64)
z = np.array([
[0, 1, 0, 1],
[2, 3, 2, 3],
[0, 1, 0, 1],
[2, 3, 2, 3]
], dtype=np.float32)
expect(node,
inputs=[x, repeats],
outputs=[z],
name='test_tile_precomputed')
Differences
0 | 0 | Constructs a tensor by tiling a given tensor. | Constructs a tensor by tiling a given tensor. |
1 | 1 | This is the same as function tile in Numpy, but no broadcast. | This is the same as function tile in Numpy, but no broadcast. |
2 | 2 | For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]] | For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]] |
3 | 3 |
|
|
4 | 4 | **Inputs** | **Inputs** |
5 | 5 |
|
|
6 | 6 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
7 | 7 | Input tensor of any shape. | Input tensor of any shape. |
8 | 8 | * **repeats** (heterogeneous) - **T1**: | * **repeats** (heterogeneous) - **T1**: |
9 | 9 | 1D int64 tensor of the same length as input's dimension number, | 1D int64 tensor of the same length as input's dimension number, |
10 | 10 | includes numbers of repeated copies along input's dimensions. | includes numbers of repeated copies along input's dimensions. |
11 | 11 |
|
|
12 | 12 | **Outputs** | **Outputs** |
13 | 13 |
|
|
14 | 14 | * **output** (heterogeneous) - **T**: | * **output** (heterogeneous) - **T**: |
15 | 15 | Output tensor of the same dimension and type as tensor input. | Output tensor of the same dimension and type as tensor input. |
16 | 16 | output_dim[i] = input_dim[i] * repeats[i] | output_dim[i] = input_dim[i] * repeats[i] |
17 | 17 |
|
|
18 | 18 | **Type Constraints** | **Type Constraints** |
19 | 19 |
|
|
20 | 20 | * **T** in ( | * **T** in ( |
21 | tensor(bfloat16), | ||
21 | 22 | tensor(bool), | tensor(bool), |
22 | 23 | tensor(complex128), | tensor(complex128), |
23 | 24 | tensor(complex64), | tensor(complex64), |
24 | 25 | tensor(double), | tensor(double), |
25 | 26 | tensor(float), | tensor(float), |
26 | 27 | tensor(float16), | tensor(float16), |
27 | 28 | tensor(int16), | tensor(int16), |
28 | 29 | tensor(int32), | tensor(int32), |
29 | 30 | tensor(int64), | tensor(int64), |
30 | 31 | tensor(int8), | tensor(int8), |
31 | 32 | tensor(string), | tensor(string), |
32 | 33 | tensor(uint16), | tensor(uint16), |
33 | 34 | tensor(uint32), | tensor(uint32), |
34 | 35 | tensor(uint64), | tensor(uint64), |
35 | 36 | tensor(uint8) | tensor(uint8) |
36 | 37 | ): | ): |
37 | 38 | Constrain input and output types to all tensor types. | Constrain input and output types to all tensor types. |
38 | 39 | * **T1** in ( | * **T1** in ( |
39 | 40 | tensor(int64) | tensor(int64) |
40 | 41 | ): | ): |
41 | 42 | Constrain repeat's type to int64 tensors. | Constrain repeat's type to int64 tensors. |
Tile - 6#
Version
name: Tile (GitHub)
domain: main
since_version: 6
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 6.
Summary
Constructs a tensor by tiling a given tensor. This is the same as function tile in Numpy, but no broadcast. For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]]
Inputs
input (heterogeneous) - T: Input tensor of any shape.
repeats (heterogeneous) - T1: 1D int64 tensor of the same length as input’s dimension number, includes numbers of repeated copies along input’s dimensions.
Outputs
output (heterogeneous) - T: Output tensor of the same dimension and type as tensor input. output_dim[i] = input_dim[i] * repeats[i]
Type Constraints
T in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.
T1 in ( tensor(int64) ): Constrain repeat’s type to int64 tensors.
Differences
0 | Repeat the elements of a tensor along an axis. | ||
1 |
| ||
2 | 0 | **Inputs** |
|
3 |
| ||
1 | This is the same as function tile in Numpy, but no broadcast. | ||
4 | 2 | * **input** (heterogeneous) - **T**: |
|
3 |
| ||
5 | 4 | Input tensor of any shape. |
|
5 |
| ||
6 | 6 | * **tiles** (heterogeneous) - **T**: |
|
7 | 7 | Number of repeated copies to make of the input tensor. |
|
8 | 8 | * **axis** (heterogeneous) - **T**: |
|
9 | 9 | Axis along which to repeat. |
|
10 | includes numbers of repeated copies along input's dimensions. | ||
10 | 11 |
|
|
11 | 12 | **Outputs** | **Outputs** |
12 | 13 |
|
|
13 | 14 | * **output** (heterogeneous) - **T**: | * **output** (heterogeneous) - **T**: |
14 | 15 | Output tensor of same shape and type as input. |
|
16 | output_dim[i] = input_dim[i] * repeats[i] | ||
15 | 17 |
|
|
16 | 18 | **Type Constraints** | **Type Constraints** |
17 | 19 |
|
|
18 | 20 | * **T** in ( | * **T** in ( |
21 | tensor(bool), | ||
22 | tensor(complex128), | ||
23 | tensor(complex64), | ||
19 | 24 | tensor(double), | tensor(double), |
20 | 25 | tensor(float), | tensor(float), |
21 | 26 | tensor(float16) |
|
27 | tensor(int16), | ||
28 | tensor(int32), | ||
29 | tensor(int64), | ||
30 | tensor(int8), | ||
31 | tensor(string), | ||
32 | tensor(uint16), | ||
33 | tensor(uint32), | ||
34 | tensor(uint64), | ||
35 | tensor(uint8) | ||
22 | 36 | ): | ): |
23 | 37 | Constrain input types to float tensors. |
|
24 | 38 | * **T1** in ( | * **T1** in ( |
25 | 39 | tensor(int64) | tensor(int64) |
26 | 40 | ): | ): |
27 | 41 | Constrain tiles and axis's type to int64 tensors. |
|
Tile - 1#
Version
name: Tile (GitHub)
domain: main
since_version: 1
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 1.
Summary
Repeat the elements of a tensor along an axis.
Inputs
input (heterogeneous) - T: Input tensor of any shape.
tiles (heterogeneous) - T: Number of repeated copies to make of the input tensor.
axis (heterogeneous) - T: Axis along which to repeat.
Outputs
output (heterogeneous) - T: Output tensor of same shape and type as input.
Type Constraints
T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.
T1 in ( tensor(int64) ): Constrain tiles and axis’s type to int64 tensors.