quark.onnx.tools.convert_resize_fs_to_pof2s

quark.onnx.tools.convert_resize_fs_to_pof2s#

Convert resize op’s float scale to pof2s.

Example : python -m quark.onnx.tools.convert_resize_fs_to_pof2s –input_model INPUT_MODEL_PATH –output_model OUTPUT_MODEL_PATH

Module Contents#

Functions#

scale2pos(→ int)

Obtain the fixed-point position corresponding to the scale.

pos2scale(→ float)

Obtain the scale corresponding to the fixed-point position.

quark.onnx.tools.convert_resize_fs_to_pof2s.scale2pos(scale: float) int#

Obtain the fixed-point position corresponding to the scale. To avoid generating infinity during computations, the range of scale is limited. :param scale: the scale :return: the fixed-point position

quark.onnx.tools.convert_resize_fs_to_pof2s.pos2scale(pos: int) float#

Obtain the scale corresponding to the fixed-point position. :param scale: the fixed-point position :return: the scale