MCPcopy Create free account
hub / github.com/apache/tvm / test_set_input_tuple

Function test_set_input_tuple

tests/python/relax/test_vm_build.py:1168–1182  ·  view source on GitHub ↗
(exec_mode)

Source from the content-addressed store, hash-verified

1166
1167
1168def test_set_input_tuple(exec_mode):
1169 @tvm.script.ir_module
1170 class MyMod:
1171 @R.function
1172 def main(x: R.Tuple([R.Tensor((32,), "float32"), R.Tensor((32,), "float32")])) -> R.Tensor:
1173 y = x[0]
1174 return y
1175
1176 temp = utils.tempdir()
1177 vm, device = make_vm(MyMod, exec_mode, temp)
1178 device = tvm.cpu(0)
1179 a = tvm.runtime.empty((32,), "float32", device=device)
1180 b = tvm.runtime.empty((32,), "float32", device=device)
1181 vm.set_input("main", (a, b))
1182 vm.invoke_stateful("main")
1183
1184
1185def save_function_kwargs_trial(vm: relax.VirtualMachine, device: tvm.runtime.Device) -> None:

Callers

nothing calls this directly

Calls 5

make_vmFunction · 0.85
set_inputMethod · 0.80
invoke_statefulMethod · 0.80
cpuMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…