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

Function test_shadowing

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

Source from the content-addressed store, hash-verified

451
452
453def test_shadowing():
454 @R.function
455 def foo(x: R.Tensor((4, 4), "float32")):
456 y = R.add(x, x)
457 z = R.multiply(x, y)
458 y = R.add(x, y)
459 y = z
460 y = R.multiply(y, x)
461 z = y
462 return z
463
464 x = relax.Var("x", R.Tensor((4, 4), "float32"))
465 bb = relax.BlockBuilder()
466 with bb.function("foo", (x,)):
467 y = bb.emit(relax.op.add(x, x))
468 z = bb.emit(relax.op.multiply(x, y))
469 y = bb.emit(relax.op.add(x, y))
470 y = bb.emit(z)
471 y = bb.emit(relax.op.multiply(y, x))
472 z = bb.emit(y)
473 bb.emit_func_output(z)
474
475 _check(foo, bb.get()["foo"])
476
477
478def test_match_cast():

Callers

nothing calls this directly

Calls 8

functionMethod · 0.95
emitMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
TensorMethod · 0.80
_checkFunction · 0.70
addMethod · 0.45
multiplyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…