It seems that there is no function `tvm::ir::AsText()` as you mentioned.
Instead, we can directly use `std::cout` to print the content of a 
`tvm::tir::Stmt` variable.
```cpp
  Stmt st1 = tvm::tir::LetStmt(tvm::tir::Var("x"), 1, 
tvm::tir::Evaluate(tvm::tir::Var("y")));
  std::cout <<  (st1) << '\n';
  /// Output:
  ///   with T.LetStmt(1) as x:
  ///     T.evaluate(y)
```
Alternatively, we can use `tvm::Dump` when dubugging with GDB:
```cpp
Breakpoint 2, stmt_test::Test () at /home/......./stmt-test.cc:543
543       Stmt st1 = tvm::tir::LetStmt(tvm::tir::Var("x"), 1, 
tvm::tir::Evaluate(tvm::tir::Var("y")));
(gdb) n
544       std::cout <<  (st1) << '\n';
(gdb) call tvm::Dump(st1)
with T.LetStmt(1) as x:
    y = T.int32()
    T.evaluate(y)
```
Hope the link below is helpful: 
[anirudhsundar/tvm-gdb-commands: Small set of gdb commands for useful tasks in 
tvm](https://github.com/anirudhsundar/tvm-gdb-commands)





---
[Visit Topic](https://discuss.tvm.apache.org/t/how-to-debug-tir-stmt/18407/2) 
to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/a7d4ac99f9698830f0b17523b30aa41427b6c1427d147cda80e3cc4e75646943).

Reply via email to