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

Function build_and_run

tests/python/relax/test_codegen_dnnl.py:54–63  ·  view source on GitHub ↗
(mod, inputs, legalize=False)

Source from the content-addressed store, hash-verified

52
53
54def build_and_run(mod, inputs, legalize=False):
55 target = tvm.target.Target("llvm")
56 dev = tvm.cpu()
57 inputs = [tvm.runtime.tensor(inp, dev) for inp in inputs]
58
59 with tvm.transform.PassContext(config={"relax.transform.apply_legalize_ops": legalize}):
60 ex = tvm.compile(mod, target)
61 vm = relax.VirtualMachine(ex, dev)
62 f = vm["main"]
63 return f(*inputs).numpy()
64
65
66def test_dnnl_offload():

Callers 2

get_refFunction · 0.70
test_dnnl_offloadFunction · 0.70

Calls 4

numpyMethod · 0.80
fFunction · 0.70
cpuMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…