Skip to content

Commit

Permalink
fix(frontend): notebook bug due to wrong dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
aPere3 committed Nov 14, 2024
1 parent 20d03d4 commit 30ce304
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions frontends/concrete-python/concrete/fhe/compilation/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,16 @@ def encrypt(
client_circuit = client_program.get_client_circuit(function_name)

exported = [
(None if arg is None else Value(client_circuit.prepare_input(Value_(arg), position)))
(
None
if arg is None
else Value(
client_circuit.prepare_input(
Value_(arg.astype(np.int64) if isinstance(arg, np.ndarray) else arg),
position,
)
)
)
for position, arg in enumerate(ordered_sanitized_args)
]

Expand Down Expand Up @@ -240,7 +249,12 @@ def simulate_encrypt(
(
None
if arg is None
else Value(client_circuit.simulate_prepare_input(Value_(arg), position))
else Value(
client_circuit.simulate_prepare_input(
Value_(arg.astype(np.int64) if isinstance(arg, np.ndarray) else arg),
position,
)
)
)
for position, arg in enumerate(ordered_sanitized_args)
]
Expand Down

0 comments on commit 30ce304

Please sign in to comment.