(self)
| 422 | |
| 423 | @reset_eager |
| 424 | def testGpuMultiple(self): |
| 425 | gpus = config.list_physical_devices('GPU') |
| 426 | if len(gpus) < 2: |
| 427 | self.skipTest('Need at least 2 GPUs') |
| 428 | |
| 429 | context.ensure_initialized() |
| 430 | |
| 431 | for i in range(0, len(gpus)): |
| 432 | with ops.device('/device:GPU:' + str(i)): |
| 433 | a = constant_op.constant(1.0) |
| 434 | self.evaluate(a) |
| 435 | |
| 436 | with self.assertRaisesRegexp(RuntimeError, 'unknown device'): |
| 437 | with ops.device('/device:GPU:' + str(len(gpus))): |
| 438 | a = constant_op.constant(1.0) |
| 439 | self.evaluate(a) |
| 440 | |
| 441 | @test_util.run_gpu_only |
| 442 | @reset_eager |
nothing calls this directly
no test coverage detected