docstr: Create and run a TensorFlow Graph to generate debug dumps.
  
  This is intentionally done in separate method, to make it easier to test
  the stack-top mode of source annotation.
docstr_tok: ["Create","and","run","a","TensorFlow","Graph","to","generate","debug","dumps",".","This","is","intentionally","done","in","separate","method",",","to","make","it","easier","to","test","the","stack-top","mode","of","source","annotation","."]
code: def createAndRunGraphHelper(self):
      """Create and run a TensorFlow Graph to generate debug dumps.
  
      This is intentionally done in separate method, to make it easier to test
      the stack-top mode of source annotation.
      """
  
      self.dump_root = self.get_temp_dir()
      self.curr_file_path = os.path.abspath(
          tf_inspect.getfile(tf_inspect.currentframe())
      )
  
      # Run a simple TF graph to generate some debug dumps that can be used in
      # source annotation.
      with session.Session() as sess:
          self.u_init = constant_op.constant(
              np.array([[5.0, 3.0], [-1.0, 0.0]]),
              shape=[2, 2],
              name="u_init",
          )
          self.u_init_line_number = line_number_above()
  
          self.u = variables.Variable(self.u_init, name="u")
          self.u_line_number = line_number_above()
  
          self.v_init = constant_op.constant(
              np.array([[2.0], [-1.0]]), shape=[2, 1], name="v_init"
          )
          self.v_init_line_number = line_number_above()
  
          self.v = variables.Variable(self.v_init, name="v")
          self.v_line_number = line_number_above()
  
          self.w = math_ops.matmul(self.u, self.v, name="w")
          self.w_line_number = line_number_above()
  
          self.evaluate(self.u.initializer)
          self.evaluate(self.v.initializer)
  
          run_options = config_pb2.RunOptions(
              output_partition_graphs=True
          )
          debug_utils.watch_graph(
              run_options,
              sess.graph,
              debug_urls=["file://%s" % self.dump_root],
          )
          run_metadata = config_pb2.RunMetadata()
          sess.run(
              self.w, options=run_options, run_metadata=run_metadata
          )
  
          self.dump = debug_data.DebugDumpDir(
              self.dump_root,
              partition_graphs=run_metadata.partition_graphs,
          )
          self.dump.set_python_graph(sess.graph)
  
imports: import ast
  import os
  import sys
  import tempfile
  import zipfile
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.debug.lib import debug_utils
  from tensorflow.python.debug.lib import source_utils
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import googletest
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 1 for calling the SourceHelperTest obj's underlying member method code with example usage: obj.createAndRunGraphHelper() without return types