| 389 | |
| 390 | @test_util.run_gpu_only |
| 391 | def testShouldCopy(self): |
| 392 | with ops.device('gpu:0'): |
| 393 | x = constant_op.constant(1.0) |
| 394 | y = array_ops.identity(x) |
| 395 | # The value we're testing y.device against will depend on what the behavior |
| 396 | # of not explicitly specifying a device in the context is. This behavior is |
| 397 | # subject to change (for example, in the future we may want to use GPUs, if |
| 398 | # available, when no device is explicitly provided) |
| 399 | self.assertEqual(y.device, '/job:localhost/replica:0/task:0/device:CPU:0') |
| 400 | |
| 401 | def testContextSwitchStackContainsEagerMode(self): |
| 402 | # Eager execution has been enabled, and no other context switch has |