Lunderberg opened a new pull request, #15091: URL: https://github.com/apache/tvm/pull/15091
Previously, some operations in `tvm.tir.op` required the operand to already be a `PrimExpr`, and raised an error if the operand was instead a python object. This could cause failures round-trip through TVMScript, as int32 and float32 types are printed as literals in TVMScript, relying on automatic conversion to convert them back into `PrimExpr` objects. For example, `T.expr2(T.int32(0))` is printed as `T.expr2(0)`, which then passes the python object `0` into `tvm.tir.op.expr2` when parsing the TVMScript. This commit updates the operations in `tvm.tir.op` to convert operands prior to accessing `operand.dtype`, avoiding the error and allowing these expressions to round-trip. This issue was first noticed in https://github.com/apache/tvm/pull/15076 for `T.ret(0)`, but applied to any operator that used the operand's dtype without first normalizing to `PrimExpr`. -- 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]
