tvm
tvm copied to clipboard
[Bug] IntImm Node signed integer indicates an error
Current IntImm Node can't express negative number by hexadecimal. Eg: x = tvm.tir.const(0xFFFFFFFF, "int32") x.value should be -1 rather than 4294967295
Whether we need to consider this issue?
It is currently undefined behavior. We haven’t had in-depth discussion whether or not it’s going to be an error. What do you think?
Thanks a lot. I think we need to solve this issue, because we usually use hexadecimal in computer domain.
Thanks for your feedbacks! The reason is that in tvm.tir.const(A, B), A is automatically converted to int64 and then sent to the C++ backend, while the backend method didn't check if A is within the range of B...
CC: @tqchen