class_docstr: An object holding the states surrounding the dumping callback.
class_docstr_tok: ["An","object","holding","the","states","surrounding","the","dumping","callback","."]
docstr: Op callback for tracing (dumping) a TF program's execution.
code: def callback(
      self, op_type, inputs, attrs, outputs, op_name=None, graph=None
  ):
      """Op callback for tracing (dumping) a TF program's execution."""
      del attrs  # Unused
  
      writer = self.get_writer()
      if graph:
          is_v1_graph_mode = (
              not ops.executing_eagerly_outside_functions()
          )
          context_id = self._get_context_id(
              graph
          )  # Innermost context ID.
          output_tensor_ids = self._get_symbolic_tensor_ids(
              len(outputs)
          )
          if op_type in (
              "Const",
              "Placeholder",
              "PlaceholderWithDefault",
          ):
              # In some cases, the op name of a Const or Placeholder op in a graph
              # can be duplicate (e.g., `None` or "resource").
              # When this happens, we use the output tensor name to infer
              # the non-duplicated tensor name.
              op_name = outputs[0].name.split(":")[0]
          if is_v1_graph_mode:
              for input_tensor in inputs:
                  if (
                      input_tensor in self._placeholder_to_debug_tensor
                      and outputs
                  ):
                      outputs[
                          0
                      ].op._add_control_input(  # pylint: disable=protected-access
                          self._placeholder_to_debug_tensor[
                              input_tensor
                          ].op
                      )
          graph_op_creation = debug_event_pb2.GraphOpCreation(
              op_type=op_type,
              op_name=op_name,
              graph_name=graph.name if hasattr(graph, "name") else None,
              graph_id=context_id,
              input_names=[
                  self._lookup_tensor_name(input_tensor)
                  for input_tensor in inputs
              ],
              num_outputs=len(outputs),
              output_tensor_ids=output_tensor_ids,
              code_location=self._process_stack_frames(),
          )
          writer.WriteGraphOpCreation(graph_op_creation)
          if (
              outputs
              and compat.as_bytes(op_type)
              not in op_callbacks_common.OP_CALLBACK_SKIP_OPS
          ):
              return self._instrument_symbolic_tensors(
                  outputs,
                  op_type,
                  op_name,
                  context_id,
                  output_tensor_ids,
              )
      else:
          op_type_bytes = compat.as_bytes(op_type)
          if op_type_bytes == b"DebugNumericSummaryV2":
              # TODO(b/140334369): Remove this special casing logic once op_callback.
              # automatically prevents infinite recursion in eager mode.
              return None
          if op_type_bytes in op_callbacks_common.OP_CALLBACK_SKIP_OPS:
              return None
          context_id = self._func_graph_id_from_func_name(op_type)
          input_ids = [
              t._id for t in inputs
          ]  # pylint:disable=protected-access
          output_tensor_device_ids = (
              [
                  writer.RegisterDeviceAndGetId(output.device)
                  for output in outputs
              ]
              if outputs
              else []
          )
          writer.WriteExecution(
              self._dump_eager_tensors(
                  outputs,
                  op_type,
                  input_ids,
                  output_tensor_device_ids,
                  graph_id=context_id,
              )
          )
  
imports: import atexit
  import os
  import re
  import socket
  import threading
  import uuid
  from tensorflow.core.framework import graph_debug_info_pb2
  from tensorflow.core.framework import tensor_pb2
  from tensorflow.core.protobuf import debug_event_pb2
  from tensorflow.python.debug.lib import debug_events_writer
  from tensorflow.python.debug.lib import op_callbacks_common
  from tensorflow.python.debug.lib import source_utils
  from tensorflow.python.eager import function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import op_callbacks
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_debug_ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
  from tensorflow.python.util import object_identity
  from tensorflow.python.util import tf_stack
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 16 for calling the _DumpingCallback obj's underlying member method code with example usage: obj.callback(op_type, inputs, attrs, outputs, op_name, graph) and returns: self, None, None