(self)
| 279 | |
| 280 | @test_util.run_gpu_only |
| 281 | def testSilentCopy(self): |
| 282 | # Temporarily replace the context |
| 283 | # pylint: disable=protected-access |
| 284 | old_context = context.context() |
| 285 | context._set_context(context.Context()) |
| 286 | try: |
| 287 | config.set_device_policy('silent') |
| 288 | cpu_tensor = constant_op.constant(1.0) |
| 289 | gpu_tensor = cpu_tensor.gpu() |
| 290 | self.assertAllEqual(cpu_tensor + gpu_tensor, 2.0) |
| 291 | finally: |
| 292 | context._set_context(old_context) |
| 293 | # pylint: enable=protected-access |
| 294 | |
| 295 | @test_util.run_gpu_only |
| 296 | def testSoftPlacement(self): |
nothing calls this directly
no test coverage detected