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

Function test_ANF

tests/python/relax/test_analysis_well_formed.py:442–458  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440
441
442def test_ANF():
443 # Error: Nested Call
444 gv0 = rx.Var("gv0", R.Tensor([m, n], "float32"))
445 call_node = rx.op.add(x, rx.op.add(x, x))
446 bindings = [rx.VarBinding(gv0, call_node)]
447 blocks = [rx.BindingBlock(bindings)]
448 func = build_function(blocks)
449 mod = tvm.IRModule({rx.GlobalVar("foo"): func})
450 assert not rx.analysis.check_well_formed(mod, check_struct_info=False)
451
452 # Error: Call Node in Tuple
453 gv0 = rx.Var("gv0", R.Tensor([m, n], "float32"))
454 bindings = [rx.VarBinding(gv0, rx.Tuple((x, rx.op.add(x, x))))]
455 blocks = [rx.BindingBlock(bindings)]
456 func = build_function(blocks)
457 mod = tvm.IRModule({rx.GlobalVar("foo"): func})
458 assert not rx.analysis.check_well_formed(mod, check_struct_info=False)
459
460
461def test_global_var_vs_gsymbol():

Callers

nothing calls this directly

Calls 3

build_functionFunction · 0.85
TensorMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…