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

Method testCopyBetweenDevices

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

cpuMethod · 0.80
constantMethod · 0.45
gpuMethod · 0.45
num_gpusMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected