File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -57,20 +57,21 @@ def test_func():
57
57
show (astext (f ))
58
58
59
59
60
- def test_env ():
60
+ def test_mod ():
61
61
x = relay .var ("x" , "float32" )
62
62
y = relay .var ("y" , "float32" )
63
63
z = relay .add (x , y )
64
64
z = relay .add (z , z )
65
65
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 )
69
70
assert "def @myf" in text
70
- assert "def @myf" in str (env )
71
+ assert "def @myf" in str (mod )
71
72
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 "" ))
74
75
show (text )
75
76
76
77
You can’t perform that action at this time.
0 commit comments