From 95f683f37cc86ab598db396455b0719d54a089e0 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Tue, 31 Aug 2021 10:19:38 +0200 Subject: [PATCH] refacto: do not convert to int in get_table from ArbitraryFunc - this assumption only holds for compiler v0 and there are checks in the MLIR converter to verify that the ArbitraryFunction yields integers --- hdk/common/representation/intermediate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hdk/common/representation/intermediate.py b/hdk/common/representation/intermediate.py index d9114c4a5..4a2ce8be4 100644 --- a/hdk/common/representation/intermediate.py +++ b/hdk/common/representation/intermediate.py @@ -229,11 +229,11 @@ class ArbitraryFunction(IntermediateNode): def label(self) -> str: return self.op_name - def get_table(self) -> List[int]: + def get_table(self) -> List[Any]: """Function to get the table for the current input value of this ArbitraryFunction. Returns: - List[int]: The table. + List[Any]: The table. """ # Check the input is an unsigned integer to be able to build a table assert isinstance( @@ -247,7 +247,7 @@ class ArbitraryFunction(IntermediateNode): max_input_range = self.inputs[0].data_type.max_value() + 1 table = [ - int(self.evaluate({0: input_value})) + self.evaluate({0: input_value}) for input_value in range(min_input_range, max_input_range) ]