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

Function basic_check

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

Check visitor and mutator behavior on the given statement.

(stmt, visitor_str, mutator_str)

Source from the content-addressed store, hash-verified

600
601
602def basic_check(stmt, visitor_str, mutator_str):
603 """Check visitor and mutator behavior on the given statement."""
604 # Check basic visitor
605 basic_visitor = BasicStmtVisitor()
606 basic_visitor.visit_stmt(stmt)
607
608 # Check AST printer visitor
609 log_visitor = ASTPrinter()
610 log_visitor.visit_stmt(stmt)
611 assert str(log_visitor.log) == visitor_str
612
613 # Check AST printer mutator
614 log_mutator = ASTPrinterMutator()
615 result = log_mutator.visit_stmt(stmt)
616 # Check we get back structurally equivalent statement
617 tvm.ir.assert_structural_equal(result, stmt)
618 assert str(log_mutator.log) == mutator_str
619
620
621def create_test_statements():

Callers 11

test_evaluateFunction · 0.70
test_letFunction · 0.70
test_forFunction · 0.70
test_whileFunction · 0.70
test_buffer_storeFunction · 0.70
test_seq_stmtFunction · 0.70
test_block_realizeFunction · 0.70
test_if_then_elseFunction · 0.70
test_decl_bufferFunction · 0.70
test_op_callFunction · 0.70

Calls 5

strFunction · 0.85
BasicStmtVisitorClass · 0.70
ASTPrinterClass · 0.70
ASTPrinterMutatorClass · 0.70
visit_stmtMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…