class_docstr: The user-facing class that provides metric storage functionalities.
  
  In the future we may add support for storing / logging other types of data if needed.
docstr: Add a scalar `value` to the `HistoryBuffer` associated with `name`.
  
  Args:
      smoothing_hint (bool): a 'hint' on whether this scalar is noisy and should be
          smoothed when logged. The hint will be accessible through
          :meth:`EventStorage.smoothing_hints`.  A writer may ignore the hint
          and apply custom smoothing rule.
  
          It defaults to True because most scalars we save need to be smoothed to
          provide any useful signal.
      cur_iter (int): an iteration number to set explicitly instead of current iteration
docstr_tok: ["Add","a","scalar","`","value","`","to","the","`","HistoryBuffer","`","associated","with","`","name","`",".","Args",":","smoothing_hint","(","bool",")",":","a","'hint","'","on","whether","this","scalar","is","noisy","and","should","be","smoothed","when","logged",".","The","hint","will","be","accessible","through",":","meth",":","`","EventStorage.smoothing_hints","`",".","A","writer","may","ignore","the","hint","and","apply","custom","smoothing","rule",".","It","defaults","to","True","because","most","scalars","we","save","need","to","be","smoothed","to","provide","any","useful","signal",".","cur_iter","(","int",")",":","an","iteration","number","to","set","explicitly","instead","of","current","iteration"]
code: def put_scalar(self, name, value, smoothing_hint=True, cur_iter=None):
      """
      Add a scalar `value` to the `HistoryBuffer` associated with `name`.
  
      Args:
          smoothing_hint (bool): a 'hint' on whether this scalar is noisy and should be
              smoothed when logged. The hint will be accessible through
              :meth:`EventStorage.smoothing_hints`.  A writer may ignore the hint
              and apply custom smoothing rule.
  
              It defaults to True because most scalars we save need to be smoothed to
              provide any useful signal.
          cur_iter (int): an iteration number to set explicitly instead of current iteration
      """
      name = self._current_prefix + name
      cur_iter = self._iter if cur_iter is None else cur_iter
      history = self._history[name]
      value = float(value)
      history.update(value, cur_iter)
      self._latest_scalars[name] = (value, cur_iter)
  
      existing_hint = self._smoothing_hints.get(name)
  
      if existing_hint is not None:
          assert (
              existing_hint == smoothing_hint
          ), "Scalar {} was put with a different smoothing_hint!".format(
              name
          )
      else:
          self._smoothing_hints[name] = smoothing_hint
  
imports: import datetime
  import json
  import logging
  import os
  import time
  from collections import defaultdict
  from contextlib import contextmanager
  from functools import cached_property
  from typing import Optional
  import torch
  from fvcore.common.history_buffer import HistoryBuffer
  from detectron2.utils.file_io import PathManager
label_desc: Use image node_id 3 for calling the EventStorage obj's underlying member method code with example usage: obj.put_scalar(name, value, smoothing_hint, cur_iter) without return types