code: def _append_to_scalar_dict(self, tag, scalar_value, global_step, timestamp):
          
          if tag not in self._scalar_dict.keys():
              self._scalar_dict[tag] = []
          self._scalar_dict[tag].append([timestamp, global_step, float(scalar_value)])
docs: Adds a list [timestamp, step, value] to the value of `self._scalar_dict[tag]`.
          This allows users to store scalars in memory and dump them to a json file later.