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
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.
- afe.ir.transform.requantization_fusion.can_convert_to_arith_folded_requantization(requant: ml_kernels.requantization.BaseRequantization[numpy.ndarray]) bool
Decide whether the given requantization can be converted to an ArithFoldedRequantization.
- afe.ir.transform.requantization_fusion.AttributesMutatorCallable
- afe.ir.transform.requantization_fusion.RequantizationCheckCallable
- class afe.ir.transform.requantization_fusion.FuseRequantizations
A compiler pass that does fusion on RequantizeOp nodes, such as the ones that are inserted during quantization. RequantizeOp nodes are fused into the preceding node where possible.