code: def testGradientGraph(self):
      # Note: Please don't just adjust the test to make it pass.
      # The code view logic depends on it.
      ops.reset_default_graph()
      _, _ = _run_loop_model()
      graph = ops.get_default_graph()
      forward_op = set()
      backward_op = set()
      back_to_forward = {}
      for op in graph.get_operations():
          if (
              op.name.find("gradients/") > 0
              and op.name.find("_grad/") > 0
          ):
              backward_op.add(op.name)
              idx1 = op.name.find("gradients/") + 10
              idx2 = op.name.find("_grad/")
              back_to_forward[op.name] = op.name[idx1:idx2]
          else:
              forward_op.add(op.name)
  
      for _, f in back_to_forward.items():
          self.assertTrue(f in forward_op)
  
imports: from collections import defaultdict
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.profiler import option_builder
  from tensorflow.python.profiler import model_analyzer
  from tensorflow.python.profiler.internal import model_analyzer_testlib
label_desc: Use image node_id 5 for calling the RunMetadataTest obj's underlying member method code with example usage: obj.testGradientGraph() without return types