Constant#

  • Domain: ai.onnx

  • Since version: 25

This operator produces a constant tensor. Exactly one of the provided attributes, either value, sparse_value, or value* must be specified.

Outputs

  • output (T): Output tensor containing the same value of the provided tensor.

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(float4e2m1), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(float8e8m0), tensor(int16), tensor(int2), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint2), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8).

Differences with previous version (24)#

SchemaDiff: Constant (domain 'ai.onnx')

  • old version: 24

  • new version: 25

  • breaking: no

Type constraints:

  • changed ‘T’: added types: [‘tensor(int2)’, ‘tensor(uint2)’]

Version History#