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

Function expected

tests/python/relax/test_transform_fuse_ops.py:50–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 return bb.get()
49
50 def expected():
51 bb = relax.BlockBuilder()
52 x = relax.Var("x", R.Tensor([10, 20], "float32"))
53 p0 = relax.Var("p0", R.Tensor((), "float32"))
54
55 with bb.function("fused_add_exp_squeeze", [x, p0], attrs={"Primitive": True}, private=True):
56 with bb.dataflow():
57 lv0 = bb.emit_te(topi.add, x, p0)
58 lv1 = bb.emit_te(topi.exp, lv0)
59 gv = bb.emit_output(bb.call_te(topi.squeeze, lv1))
60 bb.emit_func_output(gv)
61 fused_add_exp_squeeze = bb.get().get_global_var("fused_add_exp_squeeze")
62
63 x = relax.Var("x", R.Tensor([10, 20], "float32"))
64 with bb.function("main", [x]):
65 with bb.dataflow():
66 gv = bb.emit_output(
67 relax.Call(fused_add_exp_squeeze, [x, relax.const(1, "float32")])
68 )
69 bb.emit_func_output(gv)
70
71 return bb.get()
72
73 _check(before(), expected())
74

Callers 11

test_fuse_simpleFunction · 0.70
test_conv2d_fuseFunction · 0.70
test_concatenateFunction · 0.70
test_tuple_get_rootFunction · 0.70
test_tuple_intermediateFunction · 0.70
test_tuple_consecutiveFunction · 0.70
test_inception_likeFunction · 0.70
test_softmaxFunction · 0.70

Calls 10

functionMethod · 0.95
dataflowMethod · 0.95
emit_teMethod · 0.95
emit_outputMethod · 0.95
call_teMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
emitMethod · 0.95
TensorMethod · 0.80
get_global_varMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…