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

Method visit_constant_

python/tvm/relax/testing/ast_printer.py:116–119  ·  view source on GitHub ↗
(self, op: relax.Constant)

Source from the content-addressed store, hash-verified

114 return f"{open_tok}\n{member_lines}\n{close_tok}"
115
116 def visit_constant_(self, op: relax.Constant) -> str:
117 # simple rule of thumb: keep scalars inline, but anything larger goes on a new one
118 force_newline = len(op.data.shape) > 0
119 return self.build_expr(op, "Constant", force_newline=force_newline, data=str(op.data))
120
121 def visit_tuple_(self, op: relax.Tuple) -> str:
122 return self.build_expr(op, "Tuple", fields=self.build_list(map(self.visit_expr, op.fields)))

Callers

nothing calls this directly

Calls 2

build_exprMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected