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
This commit is contained in:
Arthur Meyre
2021-08-31 10:19:38 +02:00
parent ad0a65078f
commit 95f683f37c

View File

@@ -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)
]