class_docstr: Tests for DebugIdentityV2Op: when DebugEventsWriter is initialized.
  
  DebugEventsWriter being initialized prior to DebugIdentityV2 ops being invoked
  for the first time is the typical case (e.g., tfdbg2 running on a local
  machine with only local devices.)
class_docstr_tok: ["Tests","for","DebugIdentityV2Op",":","when","DebugEventsWriter","is","initialized",".","DebugEventsWriter","being","initialized","prior","to","DebugIdentityV2","ops","being","invoked","for","the","first","time","is","the","typical","case","(","e.g.",",","tfdbg2","running","on","a","local","machine","with","only","local","devices",".",")"]
code: def testTwoDumpRoots(self):
      another_dump_root = os.path.join(self.dump_root, "another")
      another_debug_url = "file://%s" % another_dump_root
      another_writer = debug_events_writer.DebugEventsWriter(
          another_dump_root, "test_tfdbg_run"
      )
  
      @def_function.function
      def write_debug_trace(x):
          # DebugIdentityV2 is a stateful op. It ought to be included by auto
          # control dependency.
          square = math_ops.square(x)
          gen_debug_ops.debug_identity_v2(
              square,
              tfdbg_context_id="deadbeaf",
              tensor_debug_mode=debug_event_pb2.TensorDebugMode.FULL_TENSOR,
              debug_urls=[
                  "file://%s" % self.dump_root,
                  another_debug_url,
              ],
          )
          return square + 1.0
  
      x = np.array([3.0, 4.0])
      self.assertAllClose(write_debug_trace(x), np.array([10.0, 17.0]))
      self.writer.FlushExecutionFiles()
      another_writer.FlushExecutionFiles()
      another_writer.Close()
  
      for debug_root in (self.dump_root, another_dump_root):
          with debug_events_reader.DebugEventsReader(
              debug_root
          ) as reader:
              graph_trace_iter = (
                  reader.graph_execution_traces_iterators()[0]
              )
  
              debug_event = next(graph_trace_iter).debug_event
              trace = debug_event.graph_execution_trace
              self.assertEqual(trace.tfdbg_context_id, "deadbeaf")
              self.assertEqual(trace.op_name, "")
              self.assertEqual(
                  trace.tensor_debug_mode,
                  debug_event_pb2.TensorDebugMode.FULL_TENSOR,
              )
              tensor_value = tensor_util.MakeNdarray(trace.tensor_proto)
              self.assertAllClose(tensor_value, [9.0, 16.0])
  
              with self.assertRaises(StopIteration):
                  next(graph_trace_iter)
  
imports: import os
  import numpy
  from tensorflow.core.protobuf import debug_event_pb2
  from tensorflow.python.debug.lib import debug_events_reader
  from tensorflow.python.debug.lib import debug_events_writer
  from tensorflow.python.debug.lib import dumping_callback_test_lib
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_debug_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 5 for calling the DebugIdentityV2OpTest obj's underlying member method code with example usage: obj.testTwoDumpRoots() and returns: unknown