Describe the bug
There may be some mismatch between data type of bool defined in allo and the original python one. So the not bool syntax is not compiled and executed as our wishes.
To Reproduce
import allo
from allo.ir.types import int8, bool
def testcase[Ty](flag: bool) -> "Ty":
X: Ty
if not flag:
X = 1
else:
X = 0
return X
s = allo.customize(testcase, instantiate=[int8])
mod = s.build()
flag : bool = True
output = mod(flag)
print(output)
Buggy output
[Data Type] Input type mismatch: i1 vs i32. Please use NumPy array to wrap the data to avoid possible result mismatch
warnings.warn(self.message, category=self.category)
1
Describe the bug There may be some mismatch between data type of bool defined in allo and the original python one. So the
not bool
syntax is not compiled and executed as our wishes.To Reproduce
Buggy output
Expected behavior Output 0 from the
else
branch.