Skip to content

Commit

Permalink
zp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Nov 5, 2024
1 parent 62a82f2 commit 228f983
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/brevitas/core/zero_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(

@brevitas.jit.script_method
def forward(self, x: Tensor, scale: Tensor, bit_width: Tensor) -> torch.Tensor:
stats = self.parameter_list_stats()
stats = self.parameter_list_stats(x)
return self.scale_shift_zero_point(-stats, scale, bit_width)


Expand Down Expand Up @@ -266,7 +266,7 @@ def forward(self, x: Tensor, scale: Tensor, bit_width: Tensor) -> torch.Tensor:
value = self.scale_shift_zero_point(value, scale, bit_width)
return value
else:
stats = self.parameter_list_stats()
stats = self.parameter_list_stats(x)
# workaround to avoid find_ununsed_parameter=True in DDP
stats = stats + 0. * self.value
if self.local_loss_mode:
Expand Down

0 comments on commit 228f983

Please sign in to comment.