Skip to content

Commit eb6e391

Browse files
authored
Remove unnecessary PYTORCH_TEST_WITH_SLOW env (#5631)
* Remove unnecessary PYTORCH_TEST_WITH_SLOW env * Completely remove skip
1 parent 600a3f2 commit eb6e391

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

.circleci/unittest/linux/scripts/run_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ set -e
55
eval "$(./conda/bin/conda shell.bash hook)"
66
conda activate ./env
77

8-
export PYTORCH_TEST_WITH_SLOW='1'
98
python -m torch.utils.collect_env
109
pytest --junitxml=test-results/junit.xml -v --durations 20

.circleci/unittest/windows/scripts/run_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ conda activate ./env
88
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
99
source "$this_dir/set_cuda_envs.sh"
1010

11-
export PYTORCH_TEST_WITH_SLOW='1'
1211
python -m torch.utils.collect_env
1312
pytest --junitxml=test-results/junit.xml -v --durations 20

test/test_models.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _assert_expected(output, name, prec=None, atol=None, rtol=None):
118118
torch.testing.assert_close(output, expected, rtol=rtol, atol=atol, check_dtype=False)
119119

120120

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):
122122
"""Check that a nn.Module's results in TorchScript match eager and that it can be exported"""
123123

124124
def get_export_import_copy(m):
@@ -129,20 +129,6 @@ def get_export_import_copy(m):
129129
imported = torch.jit.load(path)
130130
return imported
131131

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-
146132
sm = torch.jit.script(nn_module)
147133

148134
if eager_out is None:

0 commit comments

Comments
 (0)