class_docstr: Simple logger that buffers data in-memory.
  
  Example:
          from torchtnt.utils.loggers import InMemoryLogger
          logger = InMemoryLogger()
          logger.log("accuracy", 23.56, 10)
          logger.close()
class_docstr_tok: ["Simple","logger","that","buffers","data","in-memory",".","Example",":","from","torchtnt.utils.loggers","import","InMemoryLogger","logger","=","InMemoryLogger","(",")","logger.log","(","``","accuracy","''",",","23.56",",","10",")","logger.close","(",")"]
docstr: Log scalar data to the in-memory buffer.
  
  Args:
      name (string): a unique name to group scalars
      data (float/int/Tensor): scalar data to log
      step (int): step value to record
docstr_tok: ["Log","scalar","data","to","the","in-memory","buffer",".","Args",":","name","(","string",")",":","a","unique","name","to","group","scalars","data","(","float\/int\/Tensor",")",":","scalar","data","to","log","step","(","int",")",":","step","value","to","record"]
code: def log(self, name: str, data: Scalar, step: int) -> None:
      """Log scalar data to the in-memory buffer.
  
      Args:
          name (string): a unique name to group scalars
          data (float/int/Tensor): scalar data to log
          step (int): step value to record
      """
  
      self._log_buffer.setdefault(step, {})[name] = scalar_to_float(
          data
      )
      self._log_buffer[step]["step"] = step
      self._log_buffer[step]["time"] = monotonic()
  
file_path: tnt/torchtnt/utils/loggers/in_memory.py
imports: import atexit
  import logging
  from collections import OrderedDict
  from time import monotonic
  from typing import Dict, Mapping
  from torchtnt.utils.loggers.logger import MetricLogger, Scalar
  from torchtnt.utils.loggers.utils import scalar_to_float
label_desc: Use image node_id 4 for calling the InMemoryLogger obj's underlying member method code with example usage: obj.log(name, data, step) without return types