DequantizeLinear - version 13#

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

  • Domain: ai.onnx

  • Since version: 13

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 same shape, and can be either a scalar for per-tensor / per layer quantization, or a 1-D tensor for per-axis quantization. x_zero_point and x must have same type. x and y must have same shape. In the case of dequantizing int32, there’s no zero point (zero point is supposed to be 0).

Inputs

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

  • x_scale (tensor(float)): Scale for input ‘x’. It can be a scalar, which means a per-tensor/layer dequantization, or a 1-D tensor for per-axis dequantization.

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

Outputs

  • y (tensor(float)): N-D full precision output tensor. It has same shape as input ‘x’.

Type Constraints

  • T: Constrain ‘x_zero_point’ and ‘x’ to 8-bit/32-bit integer tensor. Allowed types: tensor(int32), tensor(int8), tensor(uint8).

Differences with previous version (10)#

SchemaDiff: DequantizeLinear (domain 'ai.onnx')

  • old version: 10

  • new version: 13

  • breaking: no

Documentation:

  • line similarity: 0.36 (+4/-3 lines)

--- DequantizeLinear v10
+++ DequantizeLinear v13
@@ -1,5 +1,6 @@

-The linear dequantization operator. It consumes a quantized tensor, a scale, 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' are both scalars.
-'x_zero_point' and 'x' must have same type. 'x' and 'y' must have same shape. In the case of dequantizing int32,
+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 same shape, and can be either a scalar
+for per-tensor / per layer quantization, or a 1-D tensor for per-axis quantization.
+`x_zero_point` and `x` must have same type. `x` and `y` must have same shape. In the case of dequantizing int32,
 there's no zero point (zero point is supposed to be 0).