Skip to content

Commit

Permalink
fix(frontend): fix client decryption casting
Browse files Browse the repository at this point in the history
  • Loading branch information
aPere3 committed Oct 15, 2024
1 parent 056f931 commit 69e545d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frontends/concrete-python/concrete/fhe/compilation/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,10 @@ def decrypt(
decrypted = tuple(
client_circuit.process_output(
result._inner, position # pylint: disable=protected-access
)
.to_py_val()
.astype("int64")
).to_py_val()
for position, result in enumerate(flattened_results)
)
decrypted = tuple(d.astype("int64") if isinstance(d, np.ndarray) else d for d in decrypted)

return decrypted if len(decrypted) != 1 else decrypted[0]

Expand Down Expand Up @@ -346,11 +345,10 @@ def simulate_decrypt(
decrypted = tuple(
client_circuit.simulate_process_output(
result._inner, position # pylint: disable=protected-access
)
.to_py_val()
.astype("int64")
).to_py_val()
for position, result in enumerate(flattened_results)
)
decrypted = tuple(d.astype("int64") if isinstance(d, np.ndarray) else d for d in decrypted)

return decrypted if len(decrypted) != 1 else decrypted[0]

Expand Down

0 comments on commit 69e545d

Please sign in to comment.