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

Method testShouldCopy

tensorflow/python/eager/core_test.py:391–399  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

deviceMethod · 0.45
constantMethod · 0.45
identityMethod · 0.45

Tested by

no test coverage detected