class_docstr: This class is adapted with modifications in support of the MXNet NDArray types from
  https://github.com/lanpa/tensorboard-pytorch/blob/master/tensorboardX/writer.py.
  The `SummaryWriter` class provides a high-level api to create an event file in a
  given directory and add summaries and events to it. This class writes data to the
  event file asynchronously.
  This class is a wrapper of the FileWriter class. It's recommended that users use
  the APIs of this class to log MXNet data for visualization as they are directly compatible with
  the MXNet data types.
  
  Examples
  --------
  >>> data = mx.nd.random.uniform(size=(10, 10))
  >>> with SummaryWriter(logdir='logs') as sw:
  >>>     sw.add_histogram(tag='my_hist', values=data, global_step=0, bins=100)
docstr: Creates a `SummaryWriter` and an event file.
  On construction the summary writer creates a new event file in `logdir`.
  This event file will contain `Event` protocol buffers constructed when you
  call one of the following functions: `add_audio()`, `add_embedding()`,
  `add_histogram()`, `add_image()`, `add_pr_curve()`, `add_scalar()`, and `add_text()`.
  Please make sure that the `logdir` used here for initiailizing `SummaryWriter`
  matches the `--logdir` parameter you passed to the `tensorboard` binary in the command line
  for launching TensorBoard.
  
  Parameters
  ----------
      logdir : str
          Directory where event file will be written.
      max_queue : int
          Size of the queue for pending events and summaries.
      flush_secs: Number
          How often, in seconds, to flush the pending events and summaries to disk.
      filename_suffix : str
          Every event file's name is suffixed with `filename_suffix` if provided.
      verbose : bool
          Determines whether to print the logging messages.
docstr_tok: ["Creates","a","`","SummaryWriter","`","and","an","event","file",".","On","construction","the","summary","writer","creates","a","new","event","file","in","`","logdir","`",".","This","event","file","will","contain","`","Event","`","protocol","buffers","constructed","when","you","call","one","of","the","following","functions",":","`","add_audio","(",")","`",",","`","add_embedding","(",")","`",",","`","add_histogram","(",")","`",",","`","add_image","(",")","`",",","`","add_pr_curve","(",")","`",",","`","add_scalar","(",")","`",",","and","`","add_text","(",")","`",".","Please","make","sure","that","the","`","logdir","`","used","here","for","initiailizing","`","SummaryWriter","`","matches","the","`","--","logdir","`","parameter","you","passed","to","the","`","tensorboard","`","binary","in","the","command","line","for","launching","TensorBoard",".","Parameters","--","--","--","--","--","logdir",":","str","Directory","where","event","file","will","be","written",".","max_queue",":","int","Size","of","the","queue","for","pending","events","and","summaries",".","flush_secs",":","Number","How","often",",","in","seconds",",","to","flush","the","pending","events","and","summaries","to","disk",".","filename_suffix",":","str","Every","event","file","'s","name","is","suffixed","with","`","filename_suffix","`","if","provided",".","verbose",":","bool","Determines","whether","to","print","the","logging","messages","."]
code: def __init__(
      self,
      logdir,
      max_queue=10,
      flush_secs=120,
      filename_suffix=None,
      verbose=True,
  ):
      """
      Creates a `SummaryWriter` and an event file.
      On construction the summary writer creates a new event file in `logdir`.
      This event file will contain `Event` protocol buffers constructed when you
      call one of the following functions: `add_audio()`, `add_embedding()`,
      `add_histogram()`, `add_image()`, `add_pr_curve()`, `add_scalar()`, and `add_text()`.
      Please make sure that the `logdir` used here for initiailizing `SummaryWriter`
      matches the `--logdir` parameter you passed to the `tensorboard` binary in the command line
      for launching TensorBoard.
  
      Parameters
      ----------
          logdir : str
              Directory where event file will be written.
          max_queue : int
              Size of the queue for pending events and summaries.
          flush_secs: Number
              How often, in seconds, to flush the pending events and summaries to disk.
          filename_suffix : str
              Every event file's name is suffixed with `filename_suffix` if provided.
          verbose : bool
              Determines whether to print the logging messages.
      """
      self._file_writer = FileWriter(
          logdir=logdir,
          max_queue=max_queue,
          flush_secs=flush_secs,
          filename_suffix=filename_suffix,
          verbose=verbose,
      )
      self._max_queue = max_queue
      self._flush_secs = flush_secs
      self._filename_suffix = filename_suffix
      self._verbose = verbose
      # for writing scalars of different tags in the same plot
      self._all_writers = {
          self._file_writer.get_logdir(): self._file_writer
      }
      self._logger = None
      if verbose:
          self._logger = logging.getLogger(__name__)
          self._logger.setLevel(logging.INFO)
      self._default_bins = None
      self._text_tags = []
      # scalar value dict.
      # key: file_writer's logdir, value: list of [timestamp, global_step, value]
      self._scalar_dict = {}
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  import json
  import os
  import logging
  from .proto import event_pb2
  from .proto import summary_pb2
  from .event_file_writer import EventFileWriter
  from .summary import scalar_summary, histogram_summary, image_summary, audio_summary
  from .summary import text_summary, pr_curve_summary, _net2pb
  from .utils import _save_embedding_tsv, _make_sprite_image, _make_metadata_tsv
  from .utils import _add_embedding_config, _make_numpy_array, _get_embedding_dir
  from .utils import _is_2D_matrix
label_desc: Use image node_id 1 to create a new SummaryWriter object from inherited base classes: object with example: obj = SummaryWriter(logdir, max_queue, flush_secs, filename_suffix, verbose)