afe.ir.transform.requantization_fusion
Attributes
Classes
A compiler pass that does fusion on RequantizeOp nodes, such as the ones |
Functions
Convert the given requantization to an ArithFoldedRequantization, if possible. |
|
Decide whether the given requantization can be converted to an ArithFoldedRequantization. |
Module Contents
- afe.ir.transform.requantization_fusion.convert_to_arith_folded_requantization(requant: ml_kernels.requantization.BaseRequantization[numpy.ndarray]) ml_kernels.requantization.ArithFoldedRequantization[numpy.ndarray] | None [source]
Convert the given requantization to an ArithFoldedRequantization, if possible. Only convert if the ArithFoldedRequantization is exactly equivalent, including rounding and saturation behavior.
- Parameters:
requant – Requantization to convert
- Returns:
An ArithFoldedRequantization that is equivalent to the input. None if there is no equivalent ArithFoldedRequantization.