helper#

make_dynamic_quantize_linear_function_proto#

onnx_extended.helper.make_dynamic_quantize_linear_function_proto(domain: str, opset: int, to: int | None = None) FunctionProto[source]#

Creates the FunctionProto for function DynamicQuantizeLinear doing a quantization to float 8.

Parameters:
  • domain – local domain name

  • opset – opset to use to define the function

  • to – if None, the function has an attribute, otherwise, it is replaced by the given value

Returns:

FunctionProto

The function takes 1 input and returns 3 outputs like operator DynamicQuantizeLinear. It has one attribute to which specified the quantized type.

make_simple_dynamic_quantize_linear_function_proto#

onnx_extended.helper.make_simple_dynamic_quantize_linear_function_proto(domain: str, opset: int, to: int = 17) FunctionProto[source]#

Creates the FunctionProto for function SimpleDynamicQuantizeLinear doing a quantization to float 8. A suffix is added to the function name to tell which type is used for the quantization. It does not support nan values.

Parameters:
  • domain – local domain name

  • opset – opset to use to define the function

  • to – type to quantize into, it is hardcoded

Returns:

FunctionProto

The function takes 1 input and returns 3 outputs like operator DynamicQuantizeLinear. It has one attribute to which specified the quantized type.