Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
aPere3 committed Mar 19, 2024
1 parent a83db72 commit 47e9dfe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def clear_multiplication_count(self) -> int:
"""
return self.runtime.server.clear_multiplication_count(self.name) # pragma: no cover

@property
def clear_multiplication_count_per_parameter(self) -> Dict[Parameter, int]:
"""
Get the number of clear multiplications per parameter in the function.
Expand Down
8 changes: 1 addition & 7 deletions frontends/concrete-python/concrete/fhe/compilation/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,8 @@ def statistics(self) -> Dict:
Get all statistics of the compiled program.
"""
attributes = [
"size_of_secret_keys",
"size_of_bootstrap_keys",
"size_of_keyswitch_keys",
"size_of_inputs",
"size_of_outputs",
"p_error",
"global_p_error",
"complexity",
"programmable_bootstrap_count",
"programmable_bootstrap_count_per_parameter",
"programmable_bootstrap_count_per_tag",
Expand Down Expand Up @@ -775,7 +769,7 @@ def statistics(self) -> Dict:
"encrypted_negation_count_per_tag",
"encrypted_negation_count_per_tag_per_parameter",
]
output = {attribute: getattr(self, attribute) for attribute in attributes}
output = {attribute: getattr(self, attribute)() for attribute in attributes}
output["size_of_secret_keys"] = self.size_of_secret_keys
output["size_of_bootstrap_keys"] = self.size_of_bootstrap_keys
output["size_of_keyswitch_keys"] = self.size_of_keyswitch_keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def format_bit_width_assignments(self) -> str:

lines = []
for variable in self.bit_width_assignments.decls(): # type: ignore
if variable.name().startswith(f"{self.name}.%") or variable.name() == "input_output":
if variable.name().startswith(f"{self.name}.") or variable.name() == "input_output":
width = self.bit_width_assignments.get_interp(variable) # type: ignore
lines.append(f"{variable} = {width}")

Expand Down
18 changes: 9 additions & 9 deletions frontends/concrete-python/tests/compilation/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ def function(x):
Bit-Width Constraints
--------------------------------------------------------------------------------
%0:
%0 >= 4
main.%0 >= 4
%1:
%1 >= 6
main.%1 >= 6
%2:
%2 >= 6
%0 == %1
%1 == %2
main.%2 >= 6
main.%0 == main.%1
main.%1 == main.%2
--------------------------------------------------------------------------------
Bit-Width Assignments
--------------------------------------------------------------------------------
%0 = 6
%1 = 6
%2 = 6
max = 6
main.%0 = 6
main.%1 = 6
main.%2 = 6
main.max = 6
--------------------------------------------------------------------------------
Bit-Width Assigned Computation Graph
Expand Down

0 comments on commit 47e9dfe

Please sign in to comment.