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

Class ASTPrinterMutator

tests/python/tirx/transform/test_stmt_functor.py:227–369  ·  view source on GitHub ↗

Print TIR AST in post-order while mutating.

Source from the content-addressed store, hash-verified

225
226
227class ASTPrinterMutator(StmtMutator):
228 """Print TIR AST in post-order while mutating."""
229
230 def __init__(self) -> None:
231 super().__init__()
232 self.log = ASTLog()
233
234 def visit_bind_(self, op):
235 result = super().visit_bind_(op)
236 self.log.add("Bind")
237 return result
238
239 def visit_attr_(self, op):
240 result = super().visit_attr_(op)
241 self.log.add("AttrStmt")
242 return result
243
244 def visit_assert_(self, op):
245 result = super().visit_assert_(op)
246 self.log.add("AssertStmt")
247 return result
248
249 def visit_for_(self, op):
250 result = super().visit_for_(op)
251 self.log.add("For")
252 return result
253
254 def visit_while_(self, op):
255 result = super().visit_while_(op)
256 self.log.add("While")
257 return result
258
259 def visit_buffer_store_(self, op):
260 result = super().visit_buffer_store_(op)
261 self.log.add("BufferStore")
262 return result
263
264 def visit_seqstmt_(self, op):
265 result = super().visit_seqstmt_(op)
266 self.log.add("SeqStmt")
267 return result
268
269 def visit_evaluate_(self, op):
270 result = super().visit_evaluate_(op)
271 self.log.add("Evaluate")
272 return result
273
274 def visit_block_(self, op):
275 result = super().visit_block_(op)
276 self.log.add("Block")
277 return result
278
279 def visit_block_realize_(self, op):
280 result = super().visit_block_realize_(op)
281 self.log.add("BlockRealize")
282 return result
283
284 def visit_if_then_else_(self, op):

Callers 1

basic_checkFunction · 0.70

Calls

no outgoing calls

Tested by 1

basic_checkFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…