kueitang opened a new pull request #8668:
URL: https://github.com/apache/tvm/pull/8668
Hi,
This utility is designed for users who are prone to snap-shot the relay IR
graph on terminal.
The AST structure format covers basic relay function/expressions such as
_Function, Call, Let, Var, GlobalVar, If, Tuple, Constant_ currently.
For example:
```
A Relay IRModule:
x = relay.var("x")
y = relay.const(1)
z = relay.add(x, y)
z = relay.multiply(x, z)
mod = tvm.ir.IRModule().from_expr(z)
```
with:
```
viz_res = retv.ASTVisualization()
mod = viz_res(mod)
res = viz_res.get_output()
```
will be showed as:
```
== The AST view of the IRModule is ==
@main([Var(x)])
`--(call)
|--multiply
|--x
`--(call)
|--add
|--x
`--1
```
It is welcome to have your thoughts on the utility.
Anyways, thanks. :)
Thanks for contributing to TVM! Please refer to guideline
https://tvm.apache.org/docs/contribute/ for useful information and tips. After
the pull request is submitted, please request code reviews from
[Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers)
by @ them in the pull request thread.
--
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]