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

Function build_and_run

tests/python/relax/test_codegen_tensorrt.py:67–74  ·  view source on GitHub ↗
(mod, inputs_np, target, legalize=False)

Source from the content-addressed store, hash-verified

65
66
67def build_and_run(mod, inputs_np, target, legalize=False):
68 dev = tvm.device(target, 0)
69 with tvm.transform.PassContext(config={"relax.transform.apply_legalize_ops": legalize}):
70 ex = tvm.compile(mod, target)
71 vm = relax.VirtualMachine(ex, dev)
72 f = vm["main"]
73 inputs = [tvm.runtime.tensor(inp, dev) for inp in inputs_np]
74 return f(*inputs).numpy()
75
76
77def test_tensorrt_offload():

Callers 4

get_refFunction · 0.70
test_tensorrt_offloadFunction · 0.70
_offload_and_compareFunction · 0.70

Calls 4

numpyMethod · 0.80
fFunction · 0.70
deviceMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…