@@ -118,7 +118,7 @@ def _assert_expected(output, name, prec=None, atol=None, rtol=None):
118
118
torch .testing .assert_close (output , expected , rtol = rtol , atol = atol , check_dtype = False )
119
119
120
120
121
- def _check_jit_scriptable (nn_module , args , unwrapper = None , skip = False , eager_out = None ):
121
+ def _check_jit_scriptable (nn_module , args , unwrapper = None , eager_out = None ):
122
122
"""Check that a nn.Module's results in TorchScript match eager and that it can be exported"""
123
123
124
124
def get_export_import_copy (m ):
@@ -129,20 +129,6 @@ def get_export_import_copy(m):
129
129
imported = torch .jit .load (path )
130
130
return imported
131
131
132
- TEST_WITH_SLOW = os .getenv ("PYTORCH_TEST_WITH_SLOW" , "0" ) == "1"
133
- if not TEST_WITH_SLOW or skip :
134
- # TorchScript is not enabled, skip these tests
135
- msg = (
136
- f"The check_jit_scriptable test for { nn_module .__class__ .__name__ } was skipped. "
137
- "This test checks if the module's results in TorchScript "
138
- "match eager and that it can be exported. To run these "
139
- "tests make sure you set the environment variable "
140
- "PYTORCH_TEST_WITH_SLOW=1 and that the test is not "
141
- "manually skipped."
142
- )
143
- warnings .warn (msg , RuntimeWarning )
144
- return None
145
-
146
132
sm = torch .jit .script (nn_module )
147
133
148
134
if eager_out is None :
0 commit comments