message: TF device_test additional test cases covers
  1- merge_device api test case
diff: @@ -18,8 +18,11 @@ from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  +from tensorflow.python.eager import context
  from tensorflow.python.framework import device
  +from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  +from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  @@ -116,6 +119,20 @@ class DeviceTest(test_util.TensorFlowTestCase):
  "/job:muu/device:MyFunnyDevice:2"))
  self.assertEquals("/job:muu/task:1/device:MyFunnyDevice:2", d.to_string())
  + if not context.executing_eagerly():
  + with ops.device(device.merge_device("/device:GPU:0")):
  + var1 = variables.Variable(1.0)
  + self.assertEquals("/device:GPU:0", var1.device)
  + with ops.device(device.merge_device("/job:worker")):
  + var2 = variables.Variable(1.0)
  + self.assertEquals("/job:worker/device:GPU:0", var2.device)
  + with ops.device(device.merge_device("/device:CPU:0")):
  + var3 = variables.Variable(1.0)
  + self.assertEquals("/job:worker/device:CPU:0", var3.device)
  + with ops.device(device.merge_device("/job:ps")):
  + var4 = variables.Variable(1.0)
  + self.assertEquals("/job:ps/device:CPU:0", var4.device)
  +
  def testCanonicalName(self):
  self.assertEqual("/job:foo/replica:0",
  device.canonical_name("/job:foo/replica:0"))
  