diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-11-08 03:09:46 -0800 |
---|---|---|
committer | Andrew Selle <aselle@andyselle.com> | 2017-11-10 16:14:35 -0800 |
commit | 79ba0f0b8864eee4bf3530e492ba02bdc35b2937 (patch) | |
tree | 8756610dc00bae8204835e8b4594ac56d885497b /tensorflow/contrib/nccl | |
parent | 6b753f33c99ae6010bfc7ec6b751a8e0a1bcdfab (diff) |
Check GPU availability after creating test session.
PiperOrigin-RevId: 174983466
Diffstat (limited to 'tensorflow/contrib/nccl')
-rw-r--r-- | tensorflow/contrib/nccl/python/ops/nccl_ops_test.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/contrib/nccl/python/ops/nccl_ops_test.py b/tensorflow/contrib/nccl/python/ops/nccl_ops_test.py index 0b13e3595e..bad0abd44c 100644 --- a/tensorflow/contrib/nccl/python/ops/nccl_ops_test.py +++ b/tensorflow/contrib/nccl/python/ops/nccl_ops_test.py @@ -72,14 +72,15 @@ class NcclTestCase(test.TestCase): two. device_sets: Tuple of virtual devices to run test on. """ - if not test.is_gpu_available(): - return # Test requires access to a GPU - for dtype in [np.float32, np.int32, np.int64, np.float64]: # Create session inside outer loop to test use of # same communicator across multiple sessions. with self.test_session(use_gpu=True) as sess: + # Check GPU availability *after* creating test session, see b/68975239. + if not test.is_gpu_available(): + return # Test requires access to a GPU + for devices in device_sets: shape = (3, 4) random = (np.random.random_sample(shape) - .5) * 1024 |