From 993c8693a0db78837042de27f83a6849e2e7fbf4 Mon Sep 17 00:00:00 2001 From: Nick Fraser Date: Thu, 23 Nov 2023 11:41:22 +0000 Subject: [PATCH] [quant_tensor] Fixed NaN is zero point calculation of `__truediv__` --- src/brevitas/quant_tensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/brevitas/quant_tensor/__init__.py b/src/brevitas/quant_tensor/__init__.py index e017f5de3..ff1898db2 100644 --- a/src/brevitas/quant_tensor/__init__.py +++ b/src/brevitas/quant_tensor/__init__.py @@ -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(