Concat#

  • Domain: ai.onnx

  • Since version: 13

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.

Inputs

  • inputs (T): List of tensors for concatenation

Outputs

  • concat_result (T): Concatenated tensor

Type Constraints

  • T: Constrain output types to any tensor type. Allowed types: 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).

Examples#

test_cc_concat_2d_axis_0

Attributes:
  axis = 0
Inputs:
  x0: shape=(2, 2), dtype=float32
    [[1., 2.],
     [3., 4.]]
  x1: shape=(2, 2), dtype=float32
    [[5., 6.],
     [7., 8.]]

Outputs:
  y: shape=(4, 2), dtype=float32
    [[1., 2.],
     [3., 4.],
     [5., 6.],
     [7., 8.]]

test_cc_concat_2d_axis_negative

Attributes:
  axis = -1
Inputs:
  x0: shape=(2, 3), dtype=float32
    [[1., 2., 3.],
     [4., 5., 6.]]
  x1: shape=(2, 3), dtype=float32
    [[10., 20., 30.],
     [40., 50., 60.]]

Outputs:
  y: shape=(2, 6), dtype=float32
    [[ 1.,  2.,  3., 10., 20., 30.],
     [ 4.,  5.,  6., 40., 50., 60.]]

Differences with previous version (11)#

SchemaDiff: Concat (domain 'ai.onnx')

  • old version: 11

  • new version: 13

  • breaking: no

Type constraints:

  • changed ‘T’: added types: [‘tensor(bfloat16)’]

Version History#