MCPcopy Create free account
hub / github.com/apache/tvm / dump_ast

Function dump_ast

python/tvm/relax/testing/ast_printer.py:361–377  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

359
360
361def 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)

Callers 15

test_varFunction · 0.90
test_dataflow_varFunction · 0.90
test_match_castFunction · 0.90
test_var_bindingFunction · 0.90
test_binding_blockFunction · 0.90
test_dataflow_blockFunction · 0.90
test_seq_exprFunction · 0.90
test_shape_exprFunction · 0.90
test_funcFunction · 0.90
test_shape_ofFunction · 0.90
test_call_packedFunction · 0.90
test_op_attrsFunction · 0.90

Calls 2

visit_exprMethod · 0.95
ASTPrinterClass · 0.70

Tested by 15

test_varFunction · 0.72
test_dataflow_varFunction · 0.72
test_match_castFunction · 0.72
test_var_bindingFunction · 0.72
test_binding_blockFunction · 0.72
test_dataflow_blockFunction · 0.72
test_seq_exprFunction · 0.72
test_shape_exprFunction · 0.72
test_funcFunction · 0.72
test_shape_ofFunction · 0.72
test_call_packedFunction · 0.72
test_op_attrsFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…