Skip to content

Commit 47fd737

Browse files
committed
tests(//tests/py): Add a script path test to Python API test suite
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 5a0f7a5 commit 47fd737

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/py/test_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ def test_compile_traced(self):
3434
same = (trt_mod(self.input) - self.traced_model(self.input)).abs().max()
3535
self.assertTrue(same < 2e-3)
3636

37-
#def test_compile_script(self):
38-
# pass
37+
def test_compile_script(self):
38+
extra_info = {
39+
"input_shapes": [self.input.shape],
40+
}
41+
42+
trt_mod = trtorch.compile(self.scripted_model, extra_info)
43+
same = (trt_mod(self.input) - self.scripted_model(self.input)).abs().max()
44+
self.assertTrue(same < 2e-3)
3945

4046
class TestCheckMethodOpSupport(unittest.TestCase):
4147
def setUp(self):

0 commit comments

Comments
 (0)