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

Function expected

tests/python/relax/test_transform_fuse_tir.py:56–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 return bb.get().with_attrs({"foo": "bar"})
55
56 def expected():
57 def fused_add_exp_squeeze(x, p0):
58 add = topi.add(x, p0)
59 exp = topi.exp(add)
60 squeeze = topi.squeeze(exp)
61 return squeeze
62
63 bb = relax.BlockBuilder()
64 x = relax.Var("x", R.Tensor([10, 20], "float32"))
65 p0 = relax.Var("p0", R.Tensor([], "float32"))
66 with bb.function("main", [x, p0]):
67 with bb.dataflow():
68 gv = bb.emit_output(bb.call_te(fused_add_exp_squeeze, x, p0))
69 bb.emit_func_output(gv)
70 return bb.get().with_attrs({"foo": "bar"})
71
72 _check(before(), expected())
73

Calls 10

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…