MCPcopy Index your code
hub / github.com/apache/tvm / test_vm_formalize

Function test_vm_formalize

tests/python/relax/test_vm_execbuilder.py:119–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117
118
119def test_vm_formalize():
120 ib0 = relax.ExecBuilder()
121 ib1 = relax.ExecBuilder()
122 with ib0.function("func0", num_inputs=2):
123 ib0.emit_call("test.vm.add", args=[ib0.r(0), ib0.r(1)], dst=ib0.r(100))
124 ib0.emit_call("test.vm.mul", args=[ib0.r(1), ib0.r(100)], dst=ib0.r(50))
125 ib0.emit_ret(ib0.r(50))
126 with ib1.function("func0", num_inputs=2):
127 ib1.emit_call("test.vm.add", args=[ib1.r(0), ib1.r(1)], dst=ib1.r(2))
128 ib1.emit_call("test.vm.mul", args=[ib1.r(1), ib1.r(2)], dst=ib1.r(3))
129 ib1.emit_ret(ib1.r(3))
130 exec0 = ib0.get()
131 exec1 = ib1.get()
132 assert exec0.as_text() == exec1.as_text()
133
134
135def test_vm_operand():

Callers

nothing calls this directly

Calls 6

functionMethod · 0.95
emit_callMethod · 0.95
rMethod · 0.95
emit_retMethod · 0.95
getMethod · 0.95
as_textMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…