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

Method build_ast_node

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

Returns 'nodename(..., fields[i][0]=fields[i][1], ...)' with appropriate indentation

(self, nodename: str, force_newline=False, **kwargs: str)

Source from the content-addressed store, hash-verified

74 return self.indent_str + f"\n{self.indent_str}".join(lines)
75
76 def build_ast_node(self, nodename: str, force_newline=False, **kwargs: str) -> str:
77 """
78 Returns 'nodename(..., fields[i][0]=fields[i][1], ...)'
79 with appropriate indentation
80 """
81 return self.build_list(
82 map(lambda field: f"{field[0]}={field[1]}", kwargs.items()),
83 open_tok=f"{nodename}(",
84 close_tok=")",
85 force_newline=force_newline,
86 )
87
88 def build_expr(self, node: relax.Expr, nodename: str, force_newline=False, **kwargs: str):
89 """

Callers 10

build_exprMethod · 0.95
visit_extern_func_Method · 0.95
visit_op_Method · 0.95
visit_prim_expr_Method · 0.95
visit_type_Method · 0.95
visit_struct_info_Method · 0.95
visit_binding_block_Method · 0.95
visit_dataflow_block_Method · 0.95
visit_match_cast_Method · 0.95
visit_var_binding_Method · 0.95

Calls 2

build_listMethod · 0.95
itemsMethod · 0.45

Tested by

no test coverage detected