class_docstr: TFWriter uses tensorflow file writers and summary operations to write out
  tfevent files containing scalar batch metrics.
code: def add_scalar(
      self, name: str, value: Union[int, float, np.number], step: int
  ) -> None:
      # Fix for protobuf 3.20 breaking change that disallows assigning single-element numpy arrays
      # to float fields.
      if isinstance(value, np.ndarray):
          value = value.item()
      summary = self.createSummary()
      summary_value = summary.value.add()
      summary_value.tag = name
      summary_value.simple_value = value
      self._add_summary(summary, step)
  
file_path: determined/harness/determined/tensorboard/metric_writers/tensorflow.py
imports: import time
  from typing import Optional, Set, Union
  import numpy
  import tensorflow
  from packaging import version
  from tensorflow.core.framework import summary_pb2
  from tensorflow.core.util import event_pb2
  from tensorflow.python.summary.writer.event_file_writer import EventFileWriter
  from determined import tensorboard
label_desc: Use image node_id 2 for calling the TFWriter obj's underlying member method code with example usage: obj.add_scalar(name, value, step) without return types