def get_order_to_reverse(expect_dequant_first: bool) -> Tuple[str, str]:
        """Get the wrong order pattern which will be canonicalized."""
        if expect_dequant_first:
            # The LUT -> shift_scale op pattern will be reversed.
            wrong_order_op1 = "constexpr_lut_to_dense"
            wrong_order_op2 = "constexpr_blockwise_shift_scale"
        else:
            # The shift_scale -> LUT op pattern will be reversed.
            wrong_order_op1 = "constexpr_blockwise_shift_scale"
            wrong_order_op2 = "constexpr_lut_to_dense"

        return wrong_order_op1, wrong_order_op2
Get the wrong order pattern which will be canonicalized.
coremltools/converters/mil/mil/passes/defs/optimize_quantization.py