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

Function save_function_time_evaluator_trial

tests/python/relax/test_vm_build.py:1204–1211  ·  view source on GitHub ↗
(
    vm: relax.VirtualMachine, device: tvm.runtime.Device
)

Source from the content-addressed store, hash-verified

1202
1203
1204def save_function_time_evaluator_trial(
1205 vm: relax.VirtualMachine, device: tvm.runtime.Device
1206) -> None:
1207 # just checking that the saved function can be called in the time evaluator
1208 a = tvm.runtime.tensor(np.random.rand(32, 32).astype("float32"), device)
1209 b = tvm.runtime.tensor(np.random.rand(32, 32).astype("float32"), device)
1210 vm.save_function("main", "saved_main", a, b)
1211 vm.time_evaluator("saved_main", device)()
1212
1213
1214def test_save_function_time_evaluator(exec_mode):

Callers 1

Calls 3

save_functionMethod · 0.80
astypeMethod · 0.45
time_evaluatorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…