diff --git a/src/brevitas/proxy/float_parameter_quant.py b/src/brevitas/proxy/float_parameter_quant.py index 0d6ffd106..1e886ee6b 100644 --- a/src/brevitas/proxy/float_parameter_quant.py +++ b/src/brevitas/proxy/float_parameter_quant.py @@ -67,7 +67,7 @@ def is_ocp(self): is_e4m3 = self.mantissa_bit_width() == 3 and self.exponent_bit_width() == 4 is_ocp_e4m3 = is_e4m3 and self.inf_values() is None and self.nan_values() == (('111',)) - is_e5m2 = self.mantissa_bit_width() == 5 and self.exponent_bit_width() == 2 + is_e5m2 = self.mantissa_bit_width() == 2 and self.exponent_bit_width() == 5 is_ocp_e5m2 = is_e5m2 and self.inf_values() == ( ('00',)) and self.nan_values() == ('01', '11', '10') @@ -79,7 +79,7 @@ def is_fnuz(self): is_fnuz_e4m3 = is_e4m3 and self.inf_values() is None and self.nan_values( ) is None and self.exponent_bias() == 8 - is_e5m2 = self.mantissa_bit_width() == 5 and self.exponent_bit_width() == 2 + is_e5m2 = self.mantissa_bit_width() == 2 and self.exponent_bit_width() == 5 is_fnuz_e5m2 = is_e5m2 and self.inf_values() is None and self.nan_values( ) is None and self.exponent_bias() == 16 return is_fnuz_e4m3 or is_fnuz_e5m2 diff --git a/src/brevitas/proxy/float_runtime_quant.py b/src/brevitas/proxy/float_runtime_quant.py index 7350e5e32..d3e9edb63 100644 --- a/src/brevitas/proxy/float_runtime_quant.py +++ b/src/brevitas/proxy/float_runtime_quant.py @@ -49,7 +49,7 @@ def is_ocp(self): is_e4m3 = self.mantissa_bit_width() == 3 and self.exponent_bit_width() == 4 is_ocp_e4m3 = is_e4m3 and self.inf_values() is None and self.nan_values() == (('111',)) - is_e5m2 = self.mantissa_bit_width() == 5 and self.exponent_bit_width() == 2 + is_e5m2 = self.mantissa_bit_width() == 2 and self.exponent_bit_width() == 5 is_ocp_e5m2 = is_e5m2 and self.inf_values() == ( ('00',)) and self.nan_values() == ('01', '11', '10') @@ -61,7 +61,7 @@ def is_fnuz(self): is_fnuz_e4m3 = is_e4m3 and self.inf_values() is None and self.nan_values( ) is None and self.exponent_bias() == 8 - is_e5m2 = self.mantissa_bit_width() == 5 and self.exponent_bit_width() == 2 + is_e5m2 = self.mantissa_bit_width() == 2 and self.exponent_bit_width() == 5 is_fnuz_e5m2 = is_e5m2 and self.inf_values() is None and self.nan_values( ) is None and self.exponent_bias() == 16 return is_fnuz_e4m3 or is_fnuz_e5m2