File tree Expand file tree Collapse file tree
test/unit_test/utils_test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626class ConvertTest (unittest .TestCase ):
2727 def test_args (self ):
2828 m = SimpleAdd ()
29- tico .convert (m , m .get_example_inputs ())
29+ tico .convert (m . eval () , m .get_example_inputs ())
3030
3131 def test_kwargs (self ):
3232 m = SimpleAdd ()
3333 inputs = m .get_example_inputs ()
3434 kwargs = {"x" : inputs [0 ], "y" : inputs [1 ]}
35- tico .convert (m , tuple (), kwargs )
35+ tico .convert (m . eval () , tuple (), kwargs )
3636
3737 def test_args_kwargs (self ):
3838 m = SimpleAdd ()
3939 inputs = m .get_example_inputs ()
4040 args = (inputs [0 ],)
4141 kwargs = {"y" : inputs [1 ]}
42- tico .convert (m , args , kwargs )
42+ tico .convert (m . eval () , args , kwargs )
4343
4444
4545class ConvertFromExportedProgramTest (unittest .TestCase ):
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def setUp(self):
2828 # Input: torch.ones(1), torch.ones(1)
2929 m = SimpleAdd ()
3030 self .torch_model = m
31- self .circle_model = tico .convert (m , m .get_example_inputs ())
31+ self .circle_model = tico .convert (m . eval () , m .get_example_inputs ())
3232
3333 def test_add_float (self ):
3434 x = torch .randn (1 )
@@ -61,7 +61,7 @@ def test_concat(self):
6161 # convert
6262 m = SimpleCatDefault ()
6363 torch_model = m
64- circle_model = tico .convert (m , m .get_example_inputs ())
64+ circle_model = tico .convert (m . eval () , m .get_example_inputs ())
6565 # test
6666 x = torch .randn (3 )
6767 y = torch .randn (2 )
@@ -75,7 +75,7 @@ def test_concat_with_dim(self):
7575 # convert
7676 m = SimpleCatWithDim ()
7777 torch_model = m
78- circle_model = tico .convert (m , m .get_example_inputs ())
78+ circle_model = tico .convert (m . eval () , m .get_example_inputs ())
7979 # test
8080 x = torch .randn (3 , 3 )
8181 y = torch .randn (3 , 3 )
You can’t perform that action at this time.
0 commit comments