(vm: relax.VirtualMachine, device: tvm.runtime.Device)
| 1183 | |
| 1184 | |
| 1185 | def save_function_kwargs_trial(vm: relax.VirtualMachine, device: tvm.runtime.Device) -> None: |
| 1186 | # just checking that we can use kwargs for the args when saving a function |
| 1187 | a = tvm.runtime.tensor(np.random.rand(32, 32).astype("float32"), device) |
| 1188 | b = tvm.runtime.tensor(np.random.rand(32, 32).astype("float32"), device) |
| 1189 | vm.save_function("main", "saved_main", x=a, w=b) |
| 1190 | res0 = vm["saved_main"]() |
| 1191 | tvm.testing.assert_allclose(res0.numpy(), a.numpy() * b.numpy(), rtol=1e-7, atol=1e-7) |
| 1192 | |
| 1193 | |
| 1194 | def test_save_function_kwargs(exec_mode): |
no test coverage detected
searching dependent graphs…