DequantizeLinear - version 24#

This page documents version 24 of operator DequantizeLinear. See DequantizeLinear for the latest version (since version 25).

  • Domain: ai.onnx

  • Since version: 24

The linear dequantization operator. It consumes a quantized tensor, a scale, and a zero point to compute the full-precision tensor. The dequantization formula is y = (x - x_zero_point) * x_scale. x_scale and x_zero_point must have the same shape, determining the quantization’s granularity: a scalar for per-tensor/per-layer quantization, a 1-D tensor for per-axis quantization, or have a rank identical to the input for blocked quantization. See QuantizeLinear for details on quantization granularity.

x_zero_point and x must have the same type. x and y must have the same shape. In the case of dequantizing int32, there’s no zero point (zero point is supposed to be 0). zero-point is usually not used in the case of float8 and 4-bit types quantization, but the dequantization formula remains the same for consistency. The output type is determined by the attribute output_dtype. If output_dtype is not supplied then the output type is the same as x_scale. The output type also determines the precision of the multiplication operation.

Inputs

  • x (T1): N-D quantized input tensor to be de-quantized.

  • x_scale (T2): Scale for input x. For per-tensor/layer dequantization the scale is a scalar, for per per-axis dequantization it is a 1-D Tensor and for blocked dequantization it has the same shape as the input, except for one dimension in which blocking is performed.

  • x_zero_point (T1): Zero point for input x. Shape must match x_scale. It’s optional. Zero point is 0 when it’s not specified.

Outputs

  • y (T3): N-D full precision output tensor. It has the same shape as input x. The data type is specified by the output_dtype attribute or, in its absence, the type of x_scale.

Type Constraints

  • T1: The type of the inputs ‘x_zero_point’ and ‘x’. Allowed types: tensor(float4e2m1), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int8), tensor(uint16), tensor(uint4), tensor(uint8).

  • T2: The type of the input ‘x_scale’. Allowed types: tensor(bfloat16), tensor(float), tensor(float16), tensor(float8e8m0).

  • T3: The type of the output ‘y’. Allowed types: tensor(bfloat16), tensor(float), tensor(float16).

Differences with previous version (23)#

SchemaDiff: DequantizeLinear (domain 'ai.onnx')

  • old version: 23

  • new version: 24

  • breaking: no

Type constraints:

  • changed ‘T2’: added types: [‘tensor(float8e8m0)’]