--- /dev/null
+#!/usr/bin/env python
+
+from __future__ import print_function
+
+import subprocess
+
+
+TESTS = [
+ (
+ "Checking that caffe2.python is available",
+ "from caffe2.python import core",
+ ),
+ (
+ "Checking that MKL is available",
+ "import torch; exit(0 if torch.backends.mkl.is_available() else 1)",
+ ),
+ (
+ "Checking that CUDA archs are setup correctly",
+ "import torch; torch.randn([3,5]).cuda()",
+ ),
+ (
+ "Checking that magma is available",
+ "import torch; torch.rand(1).cuda(); exit(0 if torch.cuda.has_magma else 1)",
+ ),
+ (
+ "Checking that CuDNN is available",
+ "import torch; exit(0 if torch.backends.cudnn.is_available() else 1)",
+ ),
+]
+
+
+if __name__ == "__main__":
+
+ for description, python_commands in TESTS:
+ print(description)
+ command_args = ["python", "-c", python_commands]
+ command_string = " ".join(command_args)
+ print("Command:", command_string)
+ subprocess.check_call(command_args)
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
-echo Some smoke tests
-cd test
-
-echo Checking that caffe2.python is available
-python -c "from caffe2.python import core"
-if ERRORLEVEL 1 exit /b 1
-echo Checking that MKL is available
-python -c "import torch; exit(0 if torch.backends.mkl.is_available() else 1)"
-if ERRORLEVEL 1 exit /b 1
+pushd test
-echo Checking that CUDA archs are setup correctly
-python -c "import torch; torch.randn([3,5]).cuda()"
+echo Some smoke tests
+python %SCRIPT_HELPERS_DIR%\run_python_nn_smoketests.py
if ERRORLEVEL 1 exit /b 1
-echo Checking that magma is available
-python -c "import torch; torch.rand(1).cuda(); exit(0 if torch.cuda.has_magma else 1)"
+echo Run nn tests
+python run_test.py --include nn --verbose
if ERRORLEVEL 1 exit /b 1
-echo Checking that CuDNN is available
-python -c "import torch; exit(0 if torch.backends.cudnn.is_available() else 1)"
-if ERRORLEVEL 1 exit /b 1
+popd
-cd ..
-echo Run nn tests
-cd test && python run_test.py --include nn --verbose && cd ..