message: Change const nodes to variables in the test, so that they are not optimized
  away by the grappler constant folding pass.
diff: @@ -26,6 +26,7 @@ from tensorflow.python.client import timeline
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  +from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  @@ -140,11 +141,12 @@ class TimelineTest(test.TestCase):
  with session.Session(config=config) as sess:
  with ops.device('/cpu:0'):
  - const1 = constant_op.constant(1.0, name='const1')
  + num1 = variables.Variable(1.0, name='num1')
  with ops.device('/cpu:1'):
  - const2 = constant_op.constant(2.0, name='const2')
  + num2 = variables.Variable(2.0, name='num2')
  with ops.device('/cpu:2'):
  - result = const1 + const2 + const1 * const2
  + result = num1 + num2 + num1 * num2
  + sess.run(variables.global_variables_initializer())
  sess.run(result, options=run_options, run_metadata=run_metadata)
  self.assertTrue(run_metadata.HasField('step_stats'))
  @@ -154,12 +156,13 @@ class TimelineTest(test.TestCase):
  self._validateTrace(ctf)
  maximums = step_analysis.allocator_maximums
  self.assertTrue('cpu' in maximums)
  - cpu_max = maximums['cpu']
  - # At least const1 + const2, both float32s (4 bytes each)
  + cpu_max = maximums[
  + 'cuda_host_bfc'] if 'cuda_host_bfc' in maximums else maximums['cpu']
  + # At least num1 + num2, both float32s (4 bytes each)
  self.assertGreater(cpu_max.num_bytes, 8)
  self.assertGreater(cpu_max.timestamp, 0)
  - self.assertTrue('const1' in cpu_max.tensors)
  - self.assertTrue('const2' in cpu_max.tensors)
  + self.assertTrue('num1' in cpu_max.tensors or 'num1/read' in cpu_max.tensors)
  + self.assertTrue('num2' in cpu_max.tensors or 'num2/read' in cpu_max.tensors)
  def testManyCPUs(self):
  run_options = config_pb2.RunOptions(
  @@ -168,11 +171,12 @@ class TimelineTest(test.TestCase):
  config = config_pb2.ConfigProto(device_count={'CPU': 3})
  with session.Session(config=config) as sess:
  with ops.device('/cpu:0'):
  - const1 = constant_op.constant(1.0, name='const1')
  + num1 = variables.Variable(1.0, name='num1')
  with ops.device('/cpu:1'):
  - const2 = constant_op.constant(2.0, name='const2')
  + num2 = variables.Variable(2.0, name='num2')
  with ops.device('/cpu:2'):
  - result = const1 + const2 + const1 * const2
  + result = num1 + num2 + num1 * num2
  + sess.run(variables.global_variables_initializer())
  sess.run(result, options=run_options, run_metadata=run_metadata)
  self.assertTrue(run_metadata.HasField('step_stats'))
  step_stats = run_metadata.step_stats
  