Abs#

  • Domain: ai.onnx

  • Since version: 13

Absolute takes one input data (Tensor ) and produces one output data (Tensor ) where absolute value, y = abs(x), is applied to the tensor elementwise.

Inputs

  • X (T): Input tensor

Outputs

  • Y (T): Output tensor

Type Constraints

  • T: Constrain input and output types to all numeric tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8).

Examples#

test_cc_abs

Inputs:
  x: shape=(2, 3), dtype=float32
    [[-1.  ,  0.  ,  1.5 ],
     [-2.25,  3.5 , -4.75]]

Outputs:
  y: shape=(2, 3), dtype=float32
    [[1.  , 0.  , 1.5 ],
     [2.25, 3.5 , 4.75]]

Differences with previous version (6)#

SchemaDiff: Abs (domain 'ai.onnx')

  • old version: 6

  • new version: 13

  • breaking: no

Type constraints:

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

Version History#