diff --git a/frontends/concrete-python/concrete/fhe/compilation/compiler.py b/frontends/concrete-python/concrete/fhe/compilation/compiler.py index 19c8370ce..e274e6d69 100644 --- a/frontends/concrete-python/concrete/fhe/compilation/compiler.py +++ b/frontends/concrete-python/concrete/fhe/compilation/compiler.py @@ -199,7 +199,11 @@ class Compiler: parameters = { param: ValueDescription.of(arg, is_encrypted=(status == EncryptionStatus.ENCRYPTED)) for arg, (param, status) in zip( - sample if len(self.parameter_encryption_statuses) > 1 else (sample,), + ( + sample + if len(self.parameter_encryption_statuses) > 1 or isinstance(sample, tuple) + else (sample,) + ), self.parameter_encryption_statuses.items(), ) } diff --git a/frontends/concrete-python/tests/compilation/test_compiler.py b/frontends/concrete-python/tests/compilation/test_compiler.py index ef9baa3e9..ebe9d443a 100644 --- a/frontends/concrete-python/tests/compilation/test_compiler.py +++ b/frontends/concrete-python/tests/compilation/test_compiler.py @@ -393,3 +393,21 @@ return %0, %1 ^^^^^^^^^^^^^ multiple outputs are not supported\ """ ) + + +def test_compiler_compile_with_single_tuple_inputset(helpers): + """ + Test compiling a single argument function with an inputset made of single element tuples. + """ + + configuration = helpers.configuration() + + @fhe.compiler({"x": "encrypted"}) + def f(x): + return x + + inputset = [(3,), (4,), (5,)] + circuit = f.compile(inputset, configuration) + + sample = 4 + helpers.check_execution(circuit, f, sample)