class_docstr: Abstractly implements the SummaryWriter API.
  
  This API basically implements a number of endpoints (add_summary,
  add_session_log, etc). The endpoints all generate an event protobuf, which is
  passed to the contained event_writer.
docstr: Adds a `Summary` protocol buffer to the event file.
  
  This method wraps the provided summary in an `Event` protocol buffer
  and adds it to the event file.
  
  You can pass the result of evaluating any summary op, using
  `tf.Session.run` or
  `tf.Tensor.eval`, to this
  function. Alternatively, you can pass a `tf.compat.v1.Summary` protocol
  buffer that you populate with your own data. The latter is
  commonly done to report evaluation results in event files.
  
  Args:
    summary: A `Summary` protocol buffer, optionally serialized as a string.
    global_step: Number. Optional global step value to record with the
      summary.
code: def add_summary(self, summary, global_step=None):
      """Adds a `Summary` protocol buffer to the event file.
  
      This method wraps the provided summary in an `Event` protocol buffer
      and adds it to the event file.
  
      You can pass the result of evaluating any summary op, using
      `tf.Session.run` or
      `tf.Tensor.eval`, to this
      function. Alternatively, you can pass a `tf.compat.v1.Summary` protocol
      buffer that you populate with your own data. The latter is
      commonly done to report evaluation results in event files.
  
      Args:
        summary: A `Summary` protocol buffer, optionally serialized as a string.
        global_step: Number. Optional global step value to record with the
          summary.
      """
      if isinstance(summary, bytes):
          summ = summary_pb2.Summary()
          summ.ParseFromString(summary)
          summary = summ
  
      # We strip metadata from values with tags that we have seen before in order
      # to save space - we just store the metadata on the first value with a
      # specific tag.
      for value in summary.value:
          if not value.metadata:
              continue
  
          if value.tag in self._seen_summary_tags:
              # This tag has been encountered before. Strip the metadata.
              value.ClearField("metadata")
              continue
  
          # We encounter a value with a tag we have not encountered previously. And
          # it has metadata. Remember to strip metadata from future values with this
          # tag string.
          self._seen_summary_tags.add(value.tag)
  
      event = event_pb2.Event(summary=summary)
      self._add_event(event, global_step)
  
imports: import os.path
  import time
  import warnings
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import summary_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.util import event_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.summary import plugin_asset
  from tensorflow.python.summary.writer.event_file_writer import EventFileWriter
  from tensorflow.python.summary.writer.event_file_writer_v2 import EventFileWriterV2
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling the SummaryToEventTransformer obj's underlying member method code with example usage: obj.add_summary(summary, global_step) without return types