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

Function test_simple_func

tests/python/relax/test_tvmscript_parser.py:47–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46
47def test_simple_func():
48 @R.function
49 def foo(x: R.Tensor((128, 128), "float32")) -> R.Tensor((128, 128), "float32"):
50 R.func_attr({"Primitive": True})
51 gv0 = R.call_dps_packed("extern_func", x, R.Tensor((128, 128), dtype="float32"))
52 gv1 = R.call_dps_packed("extern_dps_func", gv0, R.Tensor((128, 128), dtype="float32"))
53 return gv1
54
55 x = relax.Var("x", R.Tensor((128, 128), "float32"))
56 bb = relax.BlockBuilder()
57 with bb.function("foo", (x,), attrs={"Primitive": True}):
58 y = bb.emit(relax.call_dps_packed("extern_func", x, R.Tensor((128, 128), dtype="float32")))
59 out = bb.emit(
60 relax.call_dps_packed("extern_dps_func", y, R.Tensor((128, 128), dtype="float32"))
61 )
62 bb.emit_func_output(out)
63
64 _check(foo, bb.get()["foo"])
65
66
67def test_error_report():

Callers

nothing calls this directly

Calls 7

functionMethod · 0.95
emitMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
TensorMethod · 0.80
call_dps_packedMethod · 0.80
_checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…