Split#
Split - 18#
Version
name: Split (GitHub)
domain: main
since_version: 18
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 18.
Summary
Split a tensor into a list of tensors, along the specified ‘axis’. Either input ‘split’ or the attribute ‘num_outputs’ should be specified, but not both. If the attribute ‘num_outputs’ is specified, then the tensor is split into equal sized parts. If the tensor is not evenly splittable into num_outputs, the last chunk will be smaller. If the input ‘split’ is specified, it indicates the sizes of each output in the split.
Attributes
axis: Which axis to split on. A negative value means counting dimensions from the back. Accepted range is [-rank, rank-1] where r = rank(input). Default value is
0
.num_outputs: Number of outputs to split parts of the tensor into. If the tensor is not evenly splittable the last chunk will be smaller.
Inputs
Between 1 and 2 inputs.
input (heterogeneous) - T: The tensor to split
split (optional, heterogeneous) - tensor(int64): Optional length of each output. Values should be >= 0.Sum of the values must be equal to the dim value at ‘axis’ specified.
Outputs
Between 1 and 2147483647 outputs.
outputs (variadic, heterogeneous) - T: One or more outputs forming list of tensors after splitting
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.
Examples
_1d_opset13
node_input = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2", "output_3"],
axis=0,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0]).astype(np.float32),
np.array([5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_1d_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2"],
axis=0,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0, 5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_1d_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
_2d_opset13
node_input = np.array(
[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [7.0, 8.0, 9.0, 10.0, 11.0, 12.0]]
).astype(np.float32)
node = onnx.helper.make_node(
"Split", inputs=["input"], outputs=["output_1", "output_2"], axis=1
)
expected_outputs = [
np.array([[1.0, 2.0, 3.0], [7.0, 8.0, 9.0]]).astype(np.float32),
np.array([[4.0, 5.0, 6.0], [10.0, 11.0, 12.0]]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_2d_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2"],
axis=1,
)
expected_outputs = [
np.array([[1.0, 2.0], [7.0, 8.0]]).astype(np.float32),
np.array([[3.0, 4.0, 5.0, 6.0], [9.0, 10.0, 11.0, 12.0]]).astype(
np.float32
),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_2d_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
_default_values_opset13
node_input = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
# If axis is not specified, split is applied on default axis 0
node = onnx.helper.make_node(
"Split", inputs=["input"], outputs=["output_1", "output_2", "output_3"]
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0]).astype(np.float32),
np.array([5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_default_axis_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split", inputs=["input", "split"], outputs=["output_1", "output_2"]
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0, 5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_default_axis_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
_zero_size_splits_opset13
# 1-dimensional tensor with dimension_size=0
node_input = np.array([]).astype(np.float32)
# Split emtpy tensor to tensors of size zero
split = np.array([0, 0, 0]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2", "output_3"],
)
expected_outputs = [
np.array([]).astype(np.float32),
np.array([]).astype(np.float32),
np.array([]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_zero_size_splits_opset13",
opset_imports=[onnx.helper.make_opsetid("", 13)],
)
_1d_opset18
node_input = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2", "output_3"],
axis=0,
num_outputs=3,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0]).astype(np.float32),
np.array([5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_1d_opset18",
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2"],
axis=0,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0, 5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_1d_opset18",
)
_2d_opset18
node_input = np.array(
[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [7.0, 8.0, 9.0, 10.0, 11.0, 12.0]]
).astype(np.float32)
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2"],
axis=1,
num_outputs=2,
)
expected_outputs = [
np.array([[1.0, 2.0, 3.0], [7.0, 8.0, 9.0]]).astype(np.float32),
np.array([[4.0, 5.0, 6.0], [10.0, 11.0, 12.0]]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_2d",
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2"],
axis=1,
)
expected_outputs = [
np.array([[1.0, 2.0], [7.0, 8.0]]).astype(np.float32),
np.array([[3.0, 4.0, 5.0, 6.0], [9.0, 10.0, 11.0, 12.0]]).astype(
np.float32
),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_2d_opset18",
)
_default_values_opset18
node_input = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]).astype(np.float32)
# If axis is not specified, split is applied on default axis 0
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2", "output_3"],
num_outputs=3,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0]).astype(np.float32),
np.array([5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_equal_parts_default_axis_opset18",
)
split = np.array([2, 4]).astype(np.int64)
node = onnx.helper.make_node(
"Split", inputs=["input", "split"], outputs=["output_1", "output_2"]
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0, 5.0, 6.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_variable_parts_default_axis_opset18",
)
_zero_size_splits_opset18
# 1-dimensional tensor with dimension_size=0
node_input = np.array([]).astype(np.float32)
# Split emtpy tensor to tensors of size zero
split = np.array([0, 0, 0]).astype(np.int64)
node = onnx.helper.make_node(
"Split",
inputs=["input", "split"],
outputs=["output_1", "output_2", "output_3"],
)
expected_outputs = [
np.array([]).astype(np.float32),
np.array([]).astype(np.float32),
np.array([]).astype(np.float32),
]
expect(
node,
inputs=[node_input, split],
outputs=expected_outputs,
name="test_split_zero_size_splits_opset18",
)
_1d_uneven_split_opset18
node_input = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]).astype(np.float32)
# If axis is not specified, split is applied on default axis 0
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2", "output_3", "output_4"],
num_outputs=4,
)
expected_outputs = [
np.array([1.0, 2.0]).astype(np.float32),
np.array([3.0, 4.0]).astype(np.float32),
np.array([5.0, 6.0]).astype(np.float32),
np.array([7.0]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_1d_uneven_split_opset18",
)
_2d_uneven_split_opset18
node_input = np.array(
[
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
[9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0],
]
).astype(np.float32)
node = onnx.helper.make_node(
"Split",
inputs=["input"],
outputs=["output_1", "output_2", "output_3"],
axis=1,
num_outputs=3,
)
expected_outputs = [
np.array([[1.0, 2.0, 3.0], [9.0, 10.0, 11.0]]).astype(np.float32),
np.array([[4.0, 5.0, 6.0], [12.0, 13.0, 14.0]]).astype(np.float32),
np.array([[7.0, 8.0], [15.0, 16.0]]).astype(np.float32),
]
expect(
node,
inputs=[node_input],
outputs=expected_outputs,
name="test_split_2d_uneven_split_opset18",
)
Differences
0 | 0 | Split a tensor into a list of tensors, along the specified |
|
1 | 1 | 'axis'. Lengths of the parts can be specified using input 'split'. |
|
2 | 2 | Otherwise, the tensor is split to equal sized parts. |
|
3 | If the tensor is not evenly splittable into num_outputs, the last chunk will be smaller. | ||
4 | If the input 'split' is specified, it indicates the sizes of each output in the split. | ||
3 | 5 |
|
|
4 | 6 | **Attributes** | **Attributes** |
5 | 7 |
|
|
6 | 8 | * **axis**: | * **axis**: |
7 | 9 | Which axis to split on. A negative value means counting dimensions | Which axis to split on. A negative value means counting dimensions |
8 | 10 | from the back. Accepted range is [-rank, rank-1] where r = | from the back. Accepted range is [-rank, rank-1] where r = |
9 | 11 | rank(input). Default value is 0. | rank(input). Default value is 0. |
12 | * **num_outputs**: | ||
13 | Number of outputs to split parts of the tensor into. If the tensor | ||
14 | is not evenly splittable the last chunk will be smaller. | ||
10 | 15 |
|
|
11 | 16 | **Inputs** | **Inputs** |
12 | 17 |
|
|
13 | 18 | Between 1 and 2 inputs. | Between 1 and 2 inputs. |
14 | 19 |
|
|
15 | 20 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
16 | 21 | The tensor to split | The tensor to split |
17 | 22 | * **split** (optional, heterogeneous) - **tensor(int64)**: | * **split** (optional, heterogeneous) - **tensor(int64)**: |
18 | 23 | Optional length of each output. Values should be >= 0.Sum of the | Optional length of each output. Values should be >= 0.Sum of the |
19 | 24 | values must be equal to the dim value at 'axis' specified. | values must be equal to the dim value at 'axis' specified. |
20 | 25 |
|
|
21 | 26 | **Outputs** | **Outputs** |
22 | 27 |
|
|
23 | 28 | Between 1 and 2147483647 outputs. | Between 1 and 2147483647 outputs. |
24 | 29 |
|
|
25 | 30 | * **outputs** (variadic, heterogeneous) - **T**: | * **outputs** (variadic, heterogeneous) - **T**: |
26 | 31 | One or more outputs forming list of tensors after splitting | One or more outputs forming list of tensors after splitting |
27 | 32 |
|
|
28 | 33 | **Type Constraints** | **Type Constraints** |
29 | 34 |
|
|
30 | 35 | * **T** in ( | * **T** in ( |
31 | 36 | tensor(bfloat16), | tensor(bfloat16), |
32 | 37 | tensor(bool), | tensor(bool), |
33 | 38 | tensor(complex128), | tensor(complex128), |
34 | 39 | tensor(complex64), | tensor(complex64), |
35 | 40 | tensor(double), | tensor(double), |
36 | 41 | tensor(float), | tensor(float), |
37 | 42 | tensor(float16), | tensor(float16), |
38 | 43 | tensor(int16), | tensor(int16), |
39 | 44 | tensor(int32), | tensor(int32), |
40 | 45 | tensor(int64), | tensor(int64), |
41 | 46 | tensor(int8), | tensor(int8), |
42 | 47 | tensor(string), | tensor(string), |
43 | 48 | tensor(uint16), | tensor(uint16), |
44 | 49 | tensor(uint32), | tensor(uint32), |
45 | 50 | tensor(uint64), | tensor(uint64), |
46 | 51 | tensor(uint8) | tensor(uint8) |
47 | 52 | ): | ): |
48 | 53 | Constrain input and output types to all tensor types. | Constrain input and output types to all tensor types. |
Split - 13#
Version
name: Split (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
Split a tensor into a list of tensors, along the specified ‘axis’. Lengths of the parts can be specified using input ‘split’. Otherwise, the tensor is split to equal sized parts.
Attributes
axis: Which axis to split on. A negative value means counting dimensions from the back. Accepted range is [-rank, rank-1] where r = rank(input). Default value is
0
.
Inputs
Between 1 and 2 inputs.
input (heterogeneous) - T: The tensor to split
split (optional, heterogeneous) - tensor(int64): Optional length of each output. Values should be >= 0.Sum of the values must be equal to the dim value at ‘axis’ specified.
Outputs
Between 1 and 2147483647 outputs.
outputs (variadic, heterogeneous) - T: One or more outputs forming list of tensors after splitting
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.
Differences
0 | 0 | Split a tensor into a list of tensors, along the specified | Split a tensor into a list of tensors, along the specified |
1 | 1 | 'axis'. Lengths of the parts can be specified using argument 'split'. |
|
2 | 2 | Otherwise, the tensor is split to equal sized parts. | Otherwise, the tensor is split to equal sized parts. |
3 | 3 |
|
|
4 | 4 | **Attributes** | **Attributes** |
5 | 5 |
|
|
6 | 6 | * **axis**: | * **axis**: |
7 | 7 | Which axis to split on. A negative value means counting dimensions | Which axis to split on. A negative value means counting dimensions |
8 | 8 | from the back. Accepted range is [-rank, rank-1] where r = | from the back. Accepted range is [-rank, rank-1] where r = |
9 | 9 | rank(input). Default value is 0. | rank(input). Default value is 0. |
10 | * **split**: | ||
10 |
| ||
11 | 11 | length of each output. Values should be >= 0. |
|
12 | 12 |
|
|
13 | 13 | **Inputs** |
|
14 | 14 |
|
|
15 | 15 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
16 | The tensor to split | ||
16 | 17 | The tensor to split |
|
18 | Optional length of each output. Values should be >= 0.Sum of the | ||
19 | values must be equal to the dim value at 'axis' specified. | ||
17 | 20 |
|
|
18 | 21 | **Outputs** | **Outputs** |
19 | 22 |
|
|
20 | 23 | Between 1 and 2147483647 outputs. | Between 1 and 2147483647 outputs. |
21 | 24 |
|
|
22 | 25 | * **outputs** (variadic, heterogeneous) - **T**: | * **outputs** (variadic, heterogeneous) - **T**: |
23 | 26 | One or more outputs forming list of tensors after splitting | One or more outputs forming list of tensors after splitting |
24 | 27 |
|
|
25 | 28 | **Type Constraints** | **Type Constraints** |
26 | 29 |
|
|
27 | 30 | * **T** in ( | * **T** in ( |
31 | tensor(bfloat16), | ||
28 | 32 | tensor(bool), | tensor(bool), |
29 | 33 | tensor(complex128), | tensor(complex128), |
30 | 34 | tensor(complex64), | tensor(complex64), |
31 | 35 | tensor(double), | tensor(double), |
32 | 36 | tensor(float), | tensor(float), |
33 | 37 | tensor(float16), | tensor(float16), |
34 | 38 | tensor(int16), | tensor(int16), |
35 | 39 | tensor(int32), | tensor(int32), |
36 | 40 | tensor(int64), | tensor(int64), |
37 | 41 | tensor(int8), | tensor(int8), |
38 | 42 | tensor(string), | tensor(string), |
39 | 43 | tensor(uint16), | tensor(uint16), |
40 | 44 | tensor(uint32), | tensor(uint32), |
41 | 45 | tensor(uint64), | tensor(uint64), |
42 | 46 | tensor(uint8) | tensor(uint8) |
43 | 47 | ): | ): |
44 | 48 | Constrain input and output types to all tensor types. | Constrain input and output types to all tensor types. |
Split - 11#
Version
name: Split (GitHub)
domain: main
since_version: 11
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 11.
Summary
Split a tensor into a list of tensors, along the specified ‘axis’. Lengths of the parts can be specified using argument ‘split’. Otherwise, the tensor is split to equal sized parts.
Attributes
axis: Which axis to split on. A negative value means counting dimensions from the back. Accepted range is [-rank, rank-1] where r = rank(input). Default value is
0
.split: length of each output. Values should be >= 0.
Inputs
input (heterogeneous) - T: The tensor to split
Outputs
Between 1 and 2147483647 outputs.
outputs (variadic, heterogeneous) - T: One or more outputs forming list of tensors after splitting
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.
Differences
0 | 0 | Split a tensor into a list of tensors, along the specified | Split a tensor into a list of tensors, along the specified |
1 | 1 | 'axis'. Lengths of the parts can be specified using argument 'split'. | 'axis'. Lengths of the parts can be specified using argument 'split'. |
2 | 2 | Otherwise, the tensor is split to equal sized parts. | Otherwise, the tensor is split to equal sized parts. |
3 | 3 |
|
|
4 | 4 | **Attributes** | **Attributes** |
5 | 5 |
|
|
6 | 6 | * **axis**: | * **axis**: |
7 | 7 | Which axis to split on. Default value is 0. |
|
8 | from the back. Accepted range is [-rank, rank-1] where r = | ||
9 | rank(input). Default value is 0. | ||
8 | 10 | * **split**: | * **split**: |
9 | 11 | length of each output |
|
10 | 12 |
|
|
11 | 13 | **Inputs** | **Inputs** |
12 | 14 |
|
|
13 | 15 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
14 | 16 | The tensor to split | The tensor to split |
15 | 17 |
|
|
16 | 18 | **Outputs** | **Outputs** |
17 | 19 |
|
|
18 | 20 | Between 1 and 2147483647 outputs. | Between 1 and 2147483647 outputs. |
19 | 21 |
|
|
20 | 22 | * **outputs** (variadic, heterogeneous) - **T**: | * **outputs** (variadic, heterogeneous) - **T**: |
21 | 23 | One or more outputs forming list of tensors after splitting | One or more outputs forming list of tensors after splitting |
22 | 24 |
|
|
23 | 25 | **Type Constraints** | **Type Constraints** |
24 | 26 |
|
|
25 | 27 | * **T** in ( | * **T** in ( |
26 | 28 | tensor(bool), | tensor(bool), |
27 | 29 | tensor(complex128), | tensor(complex128), |
28 | 30 | tensor(complex64), | tensor(complex64), |
29 | 31 | tensor(double), | tensor(double), |
30 | 32 | tensor(float), | tensor(float), |
31 | 33 | tensor(float16), | tensor(float16), |
32 | 34 | tensor(int16), | tensor(int16), |
33 | 35 | tensor(int32), | tensor(int32), |
34 | 36 | tensor(int64), | tensor(int64), |
35 | 37 | tensor(int8), | tensor(int8), |
36 | 38 | tensor(string), | tensor(string), |
37 | 39 | tensor(uint16), | tensor(uint16), |
38 | 40 | tensor(uint32), | tensor(uint32), |
39 | 41 | tensor(uint64), | tensor(uint64), |
40 | 42 | tensor(uint8) | tensor(uint8) |
41 | 43 | ): | ): |
42 | 44 | Constrain input and output types to all tensor types. | Constrain input and output types to all tensor types. |
Split - 2#
Version
name: Split (GitHub)
domain: main
since_version: 2
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 2.
Summary
Split a tensor into a list of tensors, along the specified ‘axis’. Lengths of the parts can be specified using argument ‘split’. Otherwise, the tensor is split to equal sized parts.
Attributes
axis: Which axis to split on. Default value is
0
.split: length of each output
Inputs
input (heterogeneous) - T: The tensor to split
Outputs
Between 1 and 2147483647 outputs.
outputs (variadic, heterogeneous) - T: One or more outputs forming list of tensors after splitting
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.
Differences
0 | 0 | Split a tensor into a list of tensors, along the specified | Split a tensor into a list of tensors, along the specified |
1 | 1 | 'axis'. The lengths of the split can be specified using argument 'axis' or |
|
2 | optional second input blob to the operator. Otherwise, the tensor is split | ||
3 | 2 | to equal sized parts. |
|
4 | 3 |
|
|
5 | 4 | **Attributes** | **Attributes** |
6 | 5 |
|
|
7 | 6 | * **axis**: | * **axis**: |
8 | 7 | Which axis to split on |
|
9 | 8 | * **split**: | * **split**: |
10 | 9 | length of each output | length of each output |
11 | 10 |
|
|
12 | 11 | **Inputs** | **Inputs** |
13 | 12 |
|
|
14 | Between 1 and 2 inputs. | ||
15 |
| ||
16 | 13 | * **input** (heterogeneous) - **T**: | * **input** (heterogeneous) - **T**: |
17 | The tensor to split | ||
18 | 14 | * **split** (optional, heterogeneous) - **T**: |
|
19 | Optional list of output lengths (see also arg 'split') | ||
20 | 15 |
|
|
21 | 16 | **Outputs** | **Outputs** |
22 | 17 |
|
|
23 | 18 | Between 1 and 2147483647 outputs. | Between 1 and 2147483647 outputs. |
24 | 19 |
|
|
25 | 20 | * **outputs...** (variadic, heterogeneous) - **T**: |
|
26 | 21 | One or more outputs forming list of tensors after splitting | One or more outputs forming list of tensors after splitting |
27 | 22 |
|
|
28 | 23 | **Type Constraints** | **Type Constraints** |
29 | 24 |
|
|
30 | 25 | * **T** in ( | * **T** in ( |
26 | tensor(bool), | ||
27 | tensor(complex128), | ||
28 | tensor(complex64), | ||
31 | 29 | tensor(double), | tensor(double), |
32 | 30 | tensor(float), | tensor(float), |
33 | 31 | tensor(float16) |
|
32 | tensor(int16), | ||
33 | tensor(int32), | ||
34 | tensor(int64), | ||
35 | tensor(int8), | ||
36 | tensor(string), | ||
37 | tensor(uint16), | ||
38 | tensor(uint32), | ||
39 | tensor(uint64), | ||
40 | tensor(uint8) | ||
34 | 41 | ): | ): |
35 | 42 | Constrain input types to float tensors. |
|
Split - 1#
Version
name: Split (GitHub)
domain: main
since_version: 1
function: False
support_level: SupportType.COMMON
shape inference: False
This version of the operator has been available since version 1.
Summary
Split a tensor into a list of tensors, along the specified ‘axis’. The lengths of the split can be specified using argument ‘axis’ or optional second input blob to the operator. Otherwise, the tensor is split to equal sized parts.
Attributes
axis: Which axis to split on
split: length of each output
Inputs
Between 1 and 2 inputs.
input (heterogeneous) - T: The tensor to split
split (optional, heterogeneous) - T: Optional list of output lengths (see also arg ‘split’)
Outputs
Between 1 and 2147483647 outputs.
outputs… (variadic, heterogeneous) - T: One or more outputs forming list of tensors after splitting
Type Constraints
T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.