Dequantize

Dequantize // Maps quantized input to real output

Description

Produces a tensor of element type type and the same shape as input where the value of each coordinate \(i\) of output is the corresponding coordinate of input minus zero_point quantity multiplied by scale. The coordinate \(j\) of scale and zero_point is the coordinate of output projected onto axes.

Inputs

Name

Element Type

Shape

input

Any quantized type

Any

scale

Same as output

input shape projected onto axes

zero_point | Same as input | input shape projected onto axes

Attributes

Name

Description

type

output element type; any real type

axes

Axis positions on which scale and zero_point are specified

Outputs

Name

Element Type

Shape

output

type

Same as input

Mathematical Definition

\[\mathtt{output}_{i,j} = (\mathtt{input}_{i,j} - \mathtt{zero_point}_{j}) \mathtt{scale}_{j}\]

C++ Interface

class Dequantize : public ngraph::op::Op

Dequantize operation Maps quantized input (q) to real output (r) using scale (s) and zero point (z): r = (q - o) * s.

Public Functions

const std::string &description() const

Get the string name for the type of the node, such as Add or Multiply. The class name, must not contain spaces as it is used for codegen.

Return

A const reference to the node’s type name

Dequantize()

Constructs a Dequantize operation.

Dequantize(const Output<Node> &input, const Output<Node> &scale, const Output<Node> &zero_point, const element::Type &type, const AxisSet &axes)

Constructs a Dequantize operation.

Parameters
  • input: quantized input

  • scale: scale used for mapping

  • zero_point: zero point used for mapping

  • type: output element type

  • axes: axis positions on which scale and zero_point are specified

void validate_and_infer_types()

Throws if the node is invalid.