class_docstr: Saves data in event and summary protos for tensorboard.
class_docstr_tok: ["Saves","data","in","event","and","summary","protos","for","tensorboard","."]
docstr: Saves scalar value.
  
  Args:
    tag: str: label for this data
    value: int/float: number to log
    step: int: training step
docstr_tok: ["Saves","scalar","value",".","Args",":","tag",":","str",":","label","for","this","data","value",":","int\/float",":","number","to","log","step",":","int",":","training","step"]
code: def scalar(self, tag, value, step=None):
      """Saves scalar value.
  
      Args:
        tag: str: label for this data
        value: int/float: number to log
        step: int: training step
      """
      value = float(np.array(value))
      if step is None:
          step = self._step
      else:
          self._step = step
      summary = tf.compat.v1.Summary(
          value=[
              tf.compat.v1.Summary.Value(tag=tag, simple_value=value)
          ]
      )
      self.add_summary(summary, step)
  
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 6 for calling the SummaryWriter obj's underlying member method code with example usage: obj.scalar(tag, value, step) without return types