Unverified Commit eb6e3915 authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Remove unnecessary PYTORCH_TEST_WITH_SLOW env (#5631)

* Remove unnecessary PYTORCH_TEST_WITH_SLOW env

* Completely remove skip
parent 600a3f24
......@@ -5,6 +5,5 @@ set -e
eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env
export PYTORCH_TEST_WITH_SLOW='1'
python -m torch.utils.collect_env
pytest --junitxml=test-results/junit.xml -v --durations 20
......@@ -8,6 +8,5 @@ conda activate ./env
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$this_dir/set_cuda_envs.sh"
export PYTORCH_TEST_WITH_SLOW='1'
python -m torch.utils.collect_env
pytest --junitxml=test-results/junit.xml -v --durations 20
......@@ -118,7 +118,7 @@ def _assert_expected(output, name, prec=None, atol=None, rtol=None):
torch.testing.assert_close(output, expected, rtol=rtol, atol=atol, check_dtype=False)
def _check_jit_scriptable(nn_module, args, unwrapper=None, skip=False, eager_out=None):
def _check_jit_scriptable(nn_module, args, unwrapper=None, eager_out=None):
"""Check that a nn.Module's results in TorchScript match eager and that it can be exported"""
def get_export_import_copy(m):
......@@ -129,20 +129,6 @@ def _check_jit_scriptable(nn_module, args, unwrapper=None, skip=False, eager_out
imported = torch.jit.load(path)
return imported
TEST_WITH_SLOW = os.getenv("PYTORCH_TEST_WITH_SLOW", "0") == "1"
if not TEST_WITH_SLOW or skip:
# TorchScript is not enabled, skip these tests
msg = (
f"The check_jit_scriptable test for {nn_module.__class__.__name__} was skipped. "
"This test checks if the module's results in TorchScript "
"match eager and that it can be exported. To run these "
"tests make sure you set the environment variable "
"PYTORCH_TEST_WITH_SLOW=1 and that the test is not "
"manually skipped."
)
warnings.warn(msg, RuntimeWarning)
return None
sm = torch.jit.script(nn_module)
if eager_out is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment