(self)
| 517 | |
| 518 | @test_util.run_gpu_only |
| 519 | def testCopyBetweenDevices(self): |
| 520 | x = constant_op.constant([[1., 2.], [3., 4.]]) |
| 521 | x = x.cpu() |
| 522 | x = x.gpu() |
| 523 | x = x.gpu() |
| 524 | x = x.cpu() |
| 525 | |
| 526 | # Invalid device |
| 527 | with self.assertRaises(RuntimeError): |
| 528 | x.gpu(context.context().num_gpus() + 1) |
| 529 | |
| 530 | @test_util.run_gpu_only |
| 531 | def testCopyBetweenDevicesAsync(self): |