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

Class SimpleStmtExprVisitor

tests/python/tirx-transform/test_tir_functor.py:170–186  ·  view source on GitHub ↗

Visitor that handles both statements and expressions

Source from the content-addressed store, hash-verified

168
169@tirx.functor.visitor
170class SimpleStmtExprVisitor(PyStmtExprVisitor):
171 """Visitor that handles both statements and expressions"""
172
173 def __init__(self):
174 super().__init__()
175 self.expr_count = 0
176 self.stmt_count = 0
177 self.var_names = set()
178
179 def visit_var_(self, op: Var):
180 self.var_names.add(op.name)
181 self.expr_count += 1
182
183 def visit_evaluate_(self, op: Evaluate):
184 self.stmt_count += 1
185 # Visit the expression
186 self.visit_expr(op.value)
187
188
189@tirx.functor.mutator

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…