Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Sep 25, 2024
1 parent adf2d7a commit 1530599
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/brevitas/core/quant/int.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ def forward(self, x: Tensor) -> Tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Te
pre_threshold = self.pre_scaling_impl(x)
pre_scale = pre_threshold / int_threshold
pre_zero_point = self.pre_zero_point_impl(x, pre_scale, bit_width)
threshold = self.scaling_impl(x)
scale = threshold / int_threshold
scale = self.scaling_impl(x, int_threshold)
zero_point = self.zero_point_impl(x, scale, bit_width)
y = self.decoupled_int_quant(pre_scale, pre_zero_point, scale, zero_point, bit_width, x)
return y, scale, zero_point, bit_width, pre_scale, pre_zero_point
Expand Down Expand Up @@ -249,8 +248,7 @@ def forward(self, x: Tensor, input_bit_width: Tensor,
pre_threshold = self.pre_scaling_impl(x, input_bit_width, input_is_signed)
pre_scale = pre_threshold / int_threshold
pre_zero_point = self.pre_zero_point_impl(x, pre_scale, bit_width)
threshold = self.scaling_impl(x)
scale = threshold / int_threshold
scale = self.scaling_impl(x, int_threshold)
zero_point = self.zero_point_impl(x, scale, bit_width)
y = self.decoupled_int_quant(pre_scale, pre_zero_point, scale, zero_point, bit_width, x)
return y, scale, zero_point, bit_width, pre_scale, pre_zero_point

0 comments on commit 1530599

Please sign in to comment.