Dump an AST in a text format. Can vary the indentation string and choose whether to include type and shape annotations or call attributes.
(
exp: relax.Expr,
indent_str=" ",
include_struct_info_annotations=True,
include_call_attrs=True,
)
| 359 | |
| 360 | |
| 361 | def dump_ast( |
| 362 | exp: relax.Expr, |
| 363 | indent_str=" ", |
| 364 | include_struct_info_annotations=True, |
| 365 | include_call_attrs=True, |
| 366 | ) -> str: |
| 367 | """ |
| 368 | Dump an AST in a text format. |
| 369 | Can vary the indentation string and choose whether to include |
| 370 | type and shape annotations or call attributes. |
| 371 | """ |
| 372 | printer = ASTPrinter( |
| 373 | indent_str=indent_str, |
| 374 | include_struct_info_annotations=include_struct_info_annotations, |
| 375 | include_call_attrs=include_call_attrs, |
| 376 | ) |
| 377 | return printer.visit_expr(exp) |
searching dependent graphs…