From 30ce304140dedcae0241e58160f6577beabb05dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20P=C3=A9r=C3=A9?= Date: Thu, 14 Nov 2024 10:32:58 +0100 Subject: [PATCH] fix(frontend): notebook bug due to wrong dtype --- .../concrete/fhe/compilation/client.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/frontends/concrete-python/concrete/fhe/compilation/client.py b/frontends/concrete-python/concrete/fhe/compilation/client.py index f20aa675e7..e3b36c764d 100644 --- a/frontends/concrete-python/concrete/fhe/compilation/client.py +++ b/frontends/concrete-python/concrete/fhe/compilation/client.py @@ -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) ] @@ -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) ]