Skip to content

Commit

Permalink
[quant_tensor] Fixed NaN is zero point calculation of __truediv__
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfraser committed Nov 23, 2023
1 parent bd46f89 commit 993c869
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 993c869

Please sign in to comment.