# Concat#

## Concat - 13#

Version

• name: Concat (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

Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.

Attributes

• axis (required): Which axis to concat on. A negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(inputs)..

Inputs

Between 1 and 2147483647 inputs.

• inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

• concat_result (heterogeneous) - T: Concatenated tensor

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 output types to any tensor type.

Examples

default

```test_cases: Dict[str, Sequence[Any]] = {
"1d": ([1, 2], [3, 4]),
"2d": ([[1, 2], [3, 4]], [[5, 6], [7, 8]]),
"3d": (
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]],
[[[9, 10], [11, 12]], [[13, 14], [15, 16]]],
),
}

for test_case, values_ in test_cases.items():
values = [np.asarray(v, dtype=np.float32) for v in values_]
for i in range(len(values[0].shape)):
in_args = ["value" + str(k) for k in range(len(values))]
node = onnx.helper.make_node(
"Concat", inputs=[s for s in in_args], outputs=["output"], axis=i
)
output = np.concatenate(values, i)
expect(
node,
inputs=[v for v in values],
outputs=[output],
name="test_concat_" + test_case + "_axis_" + str(i),
)

for i in range(-len(values[0].shape), 0):
in_args = ["value" + str(k) for k in range(len(values))]
node = onnx.helper.make_node(
"Concat", inputs=[s for s in in_args], outputs=["output"], axis=i
)
output = np.concatenate(values, i)
expect(
node,
inputs=[v for v in values],
outputs=[output],
name="test_concat_" + test_case + "_axis_negative_" + str(abs(i)),
)
```

Differences

 `0` `0` `Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.` `Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.` `1` `1` `2` `2` `**Attributes**` `**Attributes**` `3` `3` `4` `4` `* **axis** (required):` `* **axis** (required):` `5` `5` ` Which axis to concat on. A negative value means counting dimensions` ` Which axis to concat on. A negative value means counting dimensions` `6` `6` ` from the back. Accepted range is [-r, r-1] where r = rank(inputs)..` ` from the back. Accepted range is [-r, r-1] where r = rank(inputs)..` `7` `7` `8` `8` `**Inputs**` `**Inputs**` `9` `9` `10` `10` `Between 1 and 2147483647 inputs.` `Between 1 and 2147483647 inputs.` `11` `11` `12` `12` `* **inputs** (variadic, heterogeneous) - **T**:` `* **inputs** (variadic, heterogeneous) - **T**:` `13` `13` ` List of tensors for concatenation` ` List of tensors for concatenation` `14` `14` `15` `15` `**Outputs**` `**Outputs**` `16` `16` `17` `17` `* **concat_result** (heterogeneous) - **T**:` `* **concat_result** (heterogeneous) - **T**:` `18` `18` ` Concatenated tensor` ` Concatenated tensor` `19` `19` `20` `20` `**Type Constraints**` `**Type Constraints**` `21` `21` `22` `22` `* **T** in (` `* **T** in (` `23` ` tensor(bfloat16),` `23` `24` ` tensor(bool),` ` tensor(bool),` `24` `25` ` tensor(complex128),` ` tensor(complex128),` `25` `26` ` tensor(complex64),` ` tensor(complex64),` `26` `27` ` tensor(double),` ` tensor(double),` `27` `28` ` tensor(float),` ` tensor(float),` `28` `29` ` tensor(float16),` ` tensor(float16),` `29` `30` ` tensor(int16),` ` tensor(int16),` `30` `31` ` tensor(int32),` ` tensor(int32),` `31` `32` ` tensor(int64),` ` tensor(int64),` `32` `33` ` tensor(int8),` ` tensor(int8),` `33` `34` ` tensor(string),` ` tensor(string),` `34` `35` ` tensor(uint16),` ` tensor(uint16),` `35` `36` ` tensor(uint32),` ` tensor(uint32),` `36` `37` ` tensor(uint64),` ` tensor(uint64),` `37` `38` ` tensor(uint8)` ` tensor(uint8)` `38` `39` ` ):` ` ):` `39` `40` ` Constrain output types to any tensor type.` ` Constrain output types to any tensor type.`

## Concat - 11#

Version

• name: Concat (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

Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.

Attributes

• axis (required): Which axis to concat on. A negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(inputs)..

Inputs

Between 1 and 2147483647 inputs.

• inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

• concat_result (heterogeneous) - T: Concatenated tensor

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 output types to any tensor type.

Differences

 `0` `0` `Concatenate a list of tensors into a single tensor` `Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.` `1` `1` `2` `2` `**Attributes**` `**Attributes**` `3` `3` `4` `4` `* **axis** (required):` `* **axis** (required):` `5` ` Which axis to concat on. A negative value means counting dimensions` `5` `6` ` Which axis to concat on` ` from the back. Accepted range is [-r, r-1] where r = rank(inputs)..` `6` `7` `7` `8` `**Inputs**` `**Inputs**` `8` `9` `9` `10` `Between 1 and 2147483647 inputs.` `Between 1 and 2147483647 inputs.` `10` `11` `11` `12` `* **inputs** (variadic, heterogeneous) - **T**:` `* **inputs** (variadic, heterogeneous) - **T**:` `12` `13` ` List of tensors for concatenation` ` List of tensors for concatenation` `13` `14` `14` `15` `**Outputs**` `**Outputs**` `15` `16` `16` `17` `* **concat_result** (heterogeneous) - **T**:` `* **concat_result** (heterogeneous) - **T**:` `17` `18` ` Concatenated tensor` ` Concatenated tensor` `18` `19` `19` `20` `**Type Constraints**` `**Type Constraints**` `20` `21` `21` `22` `* **T** in (` `* **T** in (` `22` `23` ` tensor(bool),` ` tensor(bool),` `23` `24` ` tensor(complex128),` ` tensor(complex128),` `24` `25` ` tensor(complex64),` ` tensor(complex64),` `25` `26` ` tensor(double),` ` tensor(double),` `26` `27` ` tensor(float),` ` tensor(float),` `27` `28` ` tensor(float16),` ` tensor(float16),` `28` `29` ` tensor(int16),` ` tensor(int16),` `29` `30` ` tensor(int32),` ` tensor(int32),` `30` `31` ` tensor(int64),` ` tensor(int64),` `31` `32` ` tensor(int8),` ` tensor(int8),` `32` `33` ` tensor(string),` ` tensor(string),` `33` `34` ` tensor(uint16),` ` tensor(uint16),` `34` `35` ` tensor(uint32),` ` tensor(uint32),` `35` `36` ` tensor(uint64),` ` tensor(uint64),` `36` `37` ` tensor(uint8)` ` tensor(uint8)` `37` `38` ` ):` ` ):` `38` `39` ` Constrain output types to any tensor type.` ` Constrain output types to any tensor type.`

## Concat - 4#

Version

• name: Concat (GitHub)

• domain: main

• since_version: 4

• function: False

• support_level: SupportType.COMMON

• shape inference: True

This version of the operator has been available since version 4.

Summary

Concatenate a list of tensors into a single tensor

Attributes

• axis (required): Which axis to concat on

Inputs

Between 1 and 2147483647 inputs.

• inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

• concat_result (heterogeneous) - T: Concatenated tensor

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 output types to any tensor type.

Differences

 `0` `0` `Concatenate a list of tensors into a single tensor` `Concatenate a list of tensors into a single tensor` `1` `1` `2` `2` `**Attributes**` `**Attributes**` `3` `3` `4` `4` `* **axis**:` `* **axis** (required):` `5` `5` ` Which axis to concat on. Default value is 1.` ` Which axis to concat on` `6` `6` `7` `7` `**Inputs**` `**Inputs**` `8` `8` `9` `9` `Between 1 and 2147483647 inputs.` `Between 1 and 2147483647 inputs.` `10` `10` `11` `11` `* **inputs** (variadic, heterogeneous) - **T**:` `* **inputs** (variadic, heterogeneous) - **T**:` `12` `12` ` List of tensors for concatenation` ` List of tensors for concatenation` `13` `13` `14` `14` `**Outputs**` `**Outputs**` `15` `15` `16` `16` `* **concat_result** (heterogeneous) - **T**:` `* **concat_result** (heterogeneous) - **T**:` `17` `17` ` Concatenated tensor` ` Concatenated tensor` `18` `18` `19` `19` `**Type Constraints**` `**Type Constraints**` `20` `20` `21` `21` `* **T** in (` `* **T** in (` `22` ` tensor(bool),` `23` ` tensor(complex128),` `24` ` tensor(complex64),` `22` `25` ` tensor(double),` ` tensor(double),` `23` `26` ` tensor(float),` ` tensor(float),` `24` `27` ` tensor(float16)` ` tensor(float16),` `28` ` tensor(int16),` `29` ` tensor(int32),` `30` ` tensor(int64),` `31` ` tensor(int8),` `32` ` tensor(string),` `33` ` tensor(uint16),` `34` ` tensor(uint32),` `35` ` tensor(uint64),` `36` ` tensor(uint8)` `25` `37` ` ):` ` ):` `26` `38` ` Constrain output types to float tensors.` ` Constrain output types to any tensor type.`

## Concat - 1#

Version

• name: Concat (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

Concatenate a list of tensors into a single tensor

Attributes

• axis: Which axis to concat on. Default value is 1.

Inputs

Between 1 and 2147483647 inputs.

• inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

• concat_result (heterogeneous) - T: Concatenated tensor

Type Constraints

• T in ( tensor(double), tensor(float), tensor(float16) ): Constrain output types to float tensors.