Skip to content

Commit

Permalink
missing return
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Dec 20, 2024
1 parent c5d5c19 commit 848cc7d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/brevitas/proxy/float_parameter_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ def bit_width(self):
return bit_width

def scale(self):
self.retrieve_attribute('scale')
return self.retrieve_attribute('scale')

def zero_point(self):
self.retrieve_attribute('zero_point')
return self.retrieve_attribute('zero_point')

def exponent_bit_width(self):
self.retrieve_attribute('exponent_bit_width')
return self.retrieve_attribute('exponent_bit_width')

def mantissa_bit_width(self):
self.retrieve_attribute('mantissa_bit_width')
return self.retrieve_attribute('mantissa_bit_width')

def exponent_bias(self):
self.retrieve_attribute('exponent_bias')
return self.retrieve_attribute('exponent_bias')

def is_saturating(self):
self.retrieve_attribute('is_saturating')
return self.retrieve_attribute('saturating')

def inf_values(self):
self.retrieve_attribute('inf_values')
return self.retrieve_attribute('inf_values')

def nan_values(self):
self.retrieve_attribute('nan_values')
return self.retrieve_attribute('nan_values')

@property
def is_ocp(self):
Expand Down
4 changes: 2 additions & 2 deletions src/brevitas/proxy/groupwise_float_parameter_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def __init__(self, quant_layer: nn.Module, quant_injector: Injector) -> None:
self.cache_class = _CachedIOGroupwiseFloat

def scale_(self):
self.retrieve_attribute('scale_')
return self.retrieve_attribute('scale_')

def zero_point_(self):
self.retrieve_attribute('zero_point_')
return self.retrieve_attribute('zero_point_')

@property
def group_dim(self):
Expand Down
4 changes: 2 additions & 2 deletions src/brevitas/proxy/groupwise_int_parameter_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def __init__(self, quant_layer: nn.Module, quant_injector: Injector) -> None:
self.cache_class = _CachedIOGroupwiseInt

def scale_(self):
self.retrieve_attribute('scale_')
return self.retrieve_attribute('scale_')

def zero_point_(self):
self.retrieve_attribute('zero_point_')
return self.retrieve_attribute('zero_point_')

@property
def group_dim(self):
Expand Down
6 changes: 3 additions & 3 deletions src/brevitas/proxy/parameter_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ def requires_quant_input(self):
return False

def scale(self):
self.retrieve_attribute('scale')
return self.retrieve_attribute('scale')

def zero_point(self):
self.retrieve_attribute('zero_point')
return self.retrieve_attribute('zero_point')

def bit_width(self):
self.retrieve_attribute('bit_width')
return self.retrieve_attribute('bit_width')

def create_quant_tensor(self, qt_args: Tuple[Any]) -> IntQuantTensor:
return IntQuantTensor(*qt_args, self.is_signed, self.training)
Expand Down

0 comments on commit 848cc7d

Please sign in to comment.