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

Method build_expr

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

Renders a Relax expression as a string using `build_ast_node`. Handles whether to include the struct_info fields.

(self, node: relax.Expr, nodename: str, force_newline=False, **kwargs: str)

Source from the content-addressed store, hash-verified

86 )
87
88 def build_expr(self, node: relax.Expr, nodename: str, force_newline=False, **kwargs: str):
89 """
90 Renders a Relax expression as a string using `build_ast_node`.
91 Handles whether to include the struct_info fields.
92 """
93 fields = kwargs.copy()
94 if node.struct_info_ and self.include_struct_info_annotations:
95 fields["struct_info"] = self.visit_struct_info_(node.struct_info)
96 return self.build_ast_node(nodename, force_newline=force_newline, **fields)
97
98 def build_list(
99 self, members: Iterable[str], open_tok="[", close_tok="]", force_newline=False

Callers 14

visit_constant_Method · 0.95
visit_tuple_Method · 0.95
visit_dataflow_var_Method · 0.95
visit_var_Method · 0.95
visit_shape_expr_Method · 0.95
visit_global_var_Method · 0.95
visit_function_Method · 0.95
visit_call_Method · 0.95
visit_seq_expr_Method · 0.95
visit_if_Method · 0.95
visit_prim_value_Method · 0.95
visit_string_imm_Method · 0.95

Calls 3

visit_struct_info_Method · 0.95
build_ast_nodeMethod · 0.95
copyMethod · 0.45

Tested by

no test coverage detected