diff --git a/concrete/common/representation/intermediate.py b/concrete/common/representation/intermediate.py index 9504686cd..7c83c9a3c 100644 --- a/concrete/common/representation/intermediate.py +++ b/concrete/common/representation/intermediate.py @@ -406,7 +406,7 @@ class GenericFunction(IntermediateNode): ) variable_input_dtype = cast(Integer, variable_input_dtype) - input_value_constructor = self.inputs[0].underlying_constructor + input_value_constructor = self.inputs[variable_input_idx].underlying_constructor if input_value_constructor is None: logger.info( f"{self.__class__.__name__} input data type constructor was None, defaulting to int" diff --git a/tests/numpy/test_compile.py b/tests/numpy/test_compile.py index 420dc72c8..7e868e50b 100644 --- a/tests/numpy/test_compile.py +++ b/tests/numpy/test_compile.py @@ -1088,6 +1088,20 @@ def test_compile_and_run_correctness__for_prog_with_tlu( ), True, ), + pytest.param( + lambda x: numpy.array([120, 60, 30], dtype=numpy.uint8) // x, + { + "x": EncryptedTensor(UnsignedInteger(3), shape=(2, 3)), + }, + [numpy.random.randint(1, 2 ** 3, size=(2, 3)) for _ in range(10)], + ( + [ + [1, 7, 6], + [3, 2, 5], + ], + ), + True, + ), ], ) def test_compile_and_run_tensor_correctness(