Skip to content

Commit

Permalink
minor int bit deduce change
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Feb 25, 2024
1 parent 253e051 commit caa0ea7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HGQ/quantizer/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_bits_exact(self, ref=None, pos_only=False):
k = np.zeros_like(self._max)
else:
i_neg = np.ceil(np.log2(np.abs(self._min))) # type:ignore
i_pos = np.ceil(np.log2(np.abs(self._max) + 2**-f)) # type:ignore
i_pos = np.ceil(np.log2(np.abs(self._max + 2.**-f))) # type:ignore
i = np.maximum(i_neg, i_pos)
k = (self._min.numpy() < 0) # type:ignore
i = np.clip(i, -f - k, 32)
Expand Down

0 comments on commit caa0ea7

Please sign in to comment.