class_docstr: Saves data in event and summary protos for tensorboard.
class_docstr_tok: ["Saves","data","in","event","and","summary","protos","for","tensorboard","."]
docstr: Create a new SummaryWriter.
  
  Args:
    log_dir: path to record tfevents files in.
    enable: bool: if False don't actually write or flush data.  Used in
      multihost training.
docstr_tok: ["Create","a","new","SummaryWriter",".","Args",":","log_dir",":","path","to","record","tfevents","files","in",".","enable",":","bool",":","if","False","do","n't","actually","write","or","flush","data",".","Used","in","multihost","training","."]
code: def __init__(self, log_dir, enable=True):
      """Create a new SummaryWriter.
  
      Args:
        log_dir: path to record tfevents files in.
        enable: bool: if False don't actually write or flush data.  Used in
          multihost training.
      """
      # If needed, create log_dir directory as well as missing parent directories.
      if not tf.io.gfile.isdir(log_dir):
          tf.io.gfile.makedirs(log_dir)
  
      self._event_writer = EventFileWriter(log_dir, 10, 120, None)
      self._step = 0
      self._closed = False
      self._enabled = enable
  
imports: import io
  import struct
  import time
  import warnings
  import wave
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from tensorflow.core.util import event_pb2
  from tensorflow.python.summary.writer.event_file_writer import EventFileWriter
label_desc: Use image node_id 1 to create a new SummaryWriter object  with example: obj = SummaryWriter(log_dir, enable)