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

Function test_tuple_root

tests/python/relax/test_transform_fuse_ops.py:244–268  ·  view source on GitHub ↗

Test fusion case where Tuple node is the root in its group

()

Source from the content-addressed store, hash-verified

242
243
244def test_tuple_root():
245 """Test fusion case where Tuple node is the root in its group"""
246
247 def before():
248 bb = relax.BlockBuilder()
249 x = relax.Var("x", R.Tensor((1, 16, 64, 64), "float32"))
250 with bb.function("main", [x]):
251 with bb.dataflow():
252 lv0 = bb.emit_te(
253 topi.nn.pool2d,
254 x,
255 kernel=(2, 2),
256 stride=(2, 2),
257 dilation=(1, 1),
258 padding=(0, 0, 0, 0),
259 pool_type="max",
260 )
261 lv1 = bb.emit_te(topi.nn.upsampling, lv0, scale_h=2.0, scale_w=2.0)
262 gv = bb.emit_output((lv1, x))
263 bb.emit_func_output(gv)
264
265 return bb.get()
266
267 # The fusion is supposed to make no change.
268 _check(before(), before())
269
270
271def test_fuse_tuple_get_elemwise():

Callers

nothing calls this directly

Calls 2

_checkFunction · 0.70
beforeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…