()
| 84 | |
| 85 | |
| 86 | def 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 | |
| 100 | def test_emit_cache(): |