Skip to content

Commit

Permalink
Fix TEST_CUDA import in test_cuda (#8246)
Browse files Browse the repository at this point in the history
  • Loading branch information
yf225 authored Jun 7, 2018
1 parent 14f5484 commit f2c8653
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@

from test_torch import TestTorch
from common import TestCase, get_gpu_type, to_gpu, freeze_rng_state, run_tests, PY3
from common_cuda import TEST_CUDA, TEST_MULTIGPU

# We cannot import TEST_CUDA and TEST_MULTIGPU from common_cuda here,
# because if we do that, the TEST_CUDNN line from common_cuda will be executed
# multiple times as well during the execution of this test suite, and it will
# cause CUDA OOM error on Windows.
TEST_CUDA = torch.cuda.is_available()
TEST_MULTIGPU = TEST_CUDA and torch.cuda.device_count() >= 2

if not TEST_CUDA:
print('CUDA not available, skipping tests')
Expand Down

0 comments on commit f2c8653

Please sign in to comment.