MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testSilentCopy

Method testSilentCopy

tensorflow/python/eager/ops_test.py:281–293  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 5

contextMethod · 0.45
ContextMethod · 0.45
constantMethod · 0.45
gpuMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected