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

Function test_neg_imm

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

Source from the content-addressed store, hash-verified

84
85
86def test_neg_imm():
87 ib = relax.ExecBuilder()
88
89 with ib.function("func0", num_inputs=1):
90 ib.emit_call("test.vm.add_scalar", args=[ib.imm(-3), ib.r(0)], dst=ib.r(1))
91 ib.emit_ret(ib.r(1))
92 ib.get()
93
94 ex = ib.get()
95 vm = relax.VirtualMachine(ex, tvm.cpu())
96 assert vm["func0"](1) == -2
97 assert vm["func0"](-3) == -6
98
99
100def test_emit_cache():

Callers

nothing calls this directly

Calls 7

functionMethod · 0.95
emit_callMethod · 0.95
immMethod · 0.95
rMethod · 0.95
emit_retMethod · 0.95
getMethod · 0.95
cpuMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…