fix(compilation): use proper variable input constructor during lookup table generation

This commit is contained in:
Umut
2022-01-10 15:12:03 +03:00
parent 5c44bf14eb
commit 4b647b108d
2 changed files with 15 additions and 1 deletions

View File

@@ -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"

View File

@@ -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(