Identity - version 13#

This page documents version 13 of operator Identity. See Identity for the latest version (since version 25).

  • Domain: ai.onnx

  • Since version: 13

Identity operator

Inputs

  • input (T): Input tensor

Outputs

  • output (T): Tensor to copy input into.

Type Constraints

  • T: Constrain input and output types to all tensor types. 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_identity

Node:
  Identity(x) -> (y)
Inputs:
  x: shape=(1, 3, 2, 2), dtype=float32
    [[[[ 1.,  2.],
       [ 3.,  4.]],

      [[ 5.,  6.],
       [ 7.,  8.]],

      [[ 9., 10.],
       [11., 12.]]]]

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

      [[ 5.,  6.],
       [ 7.,  8.]],

      [[ 9., 10.],
       [11., 12.]]]]

test_cc_identity_int64

Node:
  Identity(x) -> (y)
Inputs:
  x: shape=(2, 3), dtype=int64
    [[1, 2, 3],
     [4, 5, 6]]

Outputs:
  y: shape=(2, 3), dtype=int64
    [[1, 2, 3],
     [4, 5, 6]]

test_cc_identity_scalar

Node:
  Identity(x) -> (y)
Inputs:
  x: shape=(), dtype=float32
    42.

Outputs:
  y: shape=(), dtype=float32
    42.

Differences with previous version (1)#

SchemaDiff: Identity (domain 'ai.onnx')

  • old version: 1

  • new version: 13

  • breaking: no

Type constraints:

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