Skip to content

Commit

Permalink
chore: fix pcc
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery committed Mar 28, 2024
1 parent 42eb2a0 commit e824641
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/concrete/ml/quantization/base_quantized_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,13 +978,17 @@ def cnp_round(
exactness = fhe.Exactness.EXACT

if self.rounding_threshold_bits is not None:
# mypy
assert isinstance(self.rounding_threshold_bits, dict)
n_bits = self.rounding_threshold_bits.get("n_bits")
exactness = self.rounding_threshold_bits.get("method", exactness)

if n_bits is not None and calibrate_rounding:
# Compute lsbs_to_remove only when calibration is True
current_n_bits_accumulator = compute_bits_precision(x)

# mypy
assert isinstance(n_bits, int)
computed_lsbs_to_remove = current_n_bits_accumulator - n_bits

assert_true(
Expand Down

0 comments on commit e824641

Please sign in to comment.