Draft: QlinearConv, QuantizeLinear, DequantizeLinear Export
Context
This merge adds the required functions to export quantizelinear, dequantizelinear, qlinearconv metaoperators from Aidge to ONNX. These operators are not native to Aidge but are made by the recipe from aidge_quantization!41 . Exporting to any of these operators without the usage of the recipe first will result in an error.
This merge request is closely related to #42
Modified files
-
dequantizelinear.py
, added export function for dequantizelinear operator; -
quantizelinear.py
, added export function for quantizelinear operator; -
qlinearconv.py
, added export function for qlinearconv operator;
Detailed major modifications
These export functions work as any other operator function. The only difference would be replacement of the scaling factor by its inverse in quantizelinear and qlinearconv when their nodes contain a mul operator.
Aidge's quantization quantizes with a mul operator meanwhile ONNX's quantizelinear (quantize operator) quantizes using a div operation, meaning that their Scaling factor must be inversed to respect the same operation.
TODO
-
Unit test/ more testing for the inversion of SF -
Verifications and better error messages to hint at the usage of the recipe?