ganler opened a new issue, #13048: URL: https://github.com/apache/tvm/issues/13048
### Expected behavior `cast<int32>( cast<bool>(-1i64) )` should be `1`. ### Actual behavior `cast<int32>( cast<bool>(-1i64) )` returns wrong results (i.e., `-1`) in optimized graph runtime. ### Environment https://github.com/apache/tvm/commit/fa17da22c73fb9e95c27e4c28130835b628caf6b on Ubuntu 20.04. ### Steps to reproduce Preferably a minimal script to cause the issue to occur. ```python import tvm from tvm import relay import numpy as np i0 = relay.var("i0", shape=(1,), dtype="int64") cast_bool = relay.cast(i0, "bool") cast_int32 = relay.cast(cast_bool, "int32") f = relay.Function([i0], cast_int32) input = np.array([-1], dtype="int64") opt_res = relay.create_executor("graph", device=tvm.cpu()).evaluate(f)(input) debug_res = relay.create_executor("debug", device=tvm.cpu()).evaluate(f)(input) print(f"debug_res: \t{debug_res}") # [-1] print(f"opt_res: \t{opt_res}") # [1] ``` ### Triage Please refer to the list of label tags linked above to find the relevant tags and add them here in a bullet format (example below). * needs-triage -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
