Skip to content

Commit 824c907

Browse files
committed
Fix text printer
1 parent 61ff6c0 commit 824c907

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/python/relay/test_ir_text_printer.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,21 @@ def test_func():
5757
show(astext(f))
5858

5959

60-
def test_env():
60+
def test_mod():
6161
x = relay.var("x", "float32")
6262
y = relay.var("y", "float32")
6363
z = relay.add(x, y)
6464
z = relay.add(z, z)
6565
f = relay.Function([x, y], z)
66-
env = tvm.IRModule()
67-
env["myf"] = f
68-
text = astext(env)
66+
mod = tvm.IRModule()
67+
mod["myf"] = f
68+
mod = relay.transform.InferType()(mod)
69+
text = astext(mod)
6970
assert "def @myf" in text
70-
assert "def @myf" in str(env)
71+
assert "def @myf" in str(mod)
7172
assert "add(%0, %0) /* ty=float32 */" in text
72-
assert "add(%0, %0) /* ty=float32 */" in str(env)
73-
show(env.astext(annotate=lambda x: str(x.checked_type.dtype) if type(x) == relay.Call else ""))
73+
assert "add(%0, %0) /* ty=float32 */" in str(mod)
74+
show(mod.astext(annotate=lambda x: str(x.checked_type.dtype) if type(x) == relay.Call else ""))
7475
show(text)
7576

7677

0 commit comments

Comments
 (0)