keras/src/dtype_policies/dtype_policy.py/QuantizedDTypePolicy/_check_quantization_mode
class QuantizedDTypePolicy:    def _check_quantization_mode(self, mode, compute_dtype):
        if mode not in QUANTIZATION_MODES:
            raise ValueError(
                "Invalid quantization mode. "
                f"Expected one of {QUANTIZATION_MODES}. "
                f"Received: mode={mode}"
            )
        if compute_dtype == "float16" and mode == "int8":
            raise ValueError(
                f"Quantization mode='{mode}' doesn't work well with "
                "compute_dtype='float16'."
            )