Skip to content

Commit

Permalink
Fix (quant_tensor): avoid NaN in zero point calculation of `__truediv…
Browse files Browse the repository at this point in the history
…__` (#768)
  • Loading branch information
nickfraser authored Dec 20, 2023
1 parent f126171 commit 2e6e179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/brevitas/quant_tensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def __truediv__(self, other):
output_signed = self.signed or other.signed
output_training = self.training or other.training
if self.is_zero_zero_point(self) and self.is_zero_zero_point(other):
output_zero_point = self.zero_point / other.zero_point
output_zero_point = self.zero_point * other.zero_point # Output zero_point is a new, zero-valued tensor
else:
output_zero_point = None # TODO non-zero zero point
output = QuantTensor(
Expand Down

0 comments on commit 2e6e179

Please sign in to comment.