Beya2019 opened a new pull request #8499:
URL: https://github.com/apache/tvm/pull/8499
fix print bug when call
@tvm.script.tir
def abs(a: ty.handle) -> None:
A[()] = tir.abs(2.2)
A[()] = tir.abs(tir.float32(2.2))
func = abs
rt_func = tvm.script.from_source(tvm.script.asscript(func, True))
tvm.ir.assert_structural_equal(func, rt_func)
First parser result(func):
A[vi, vj] = tir.fabs(tir.cast(tir.float32(2.2000000000000002),
"float32"), dtype="float32")
A[vi, vj] = tir.float32(2.2000000000000002)
Second parser result(rt_func):
A[vi, vj] =
tir.fabs(tir.cast(tir.cast(tir.float32(2.2000000000000002), "float32"),
"float32"), dtype="float32")
A[vi, vj] = tir.cast(tir.float32(2.2000000000000002), "float32")
Second structure has an extra tir.cast compared the first, because the first
structure print the 2.2 to tir.float32(2.2) and the tir.float32(2.2) is parsed
to tir.cast(tir.float32(2.2), "float32") in second structure.
--
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]