Shortcuts

torchtnt.utils.loggers.JSONLogger

class torchtnt.utils.loggers.JSONLogger(path: str, steps_before_flushing: int = 100, log_all_ranks: bool = False)

JSON file logger.

Parameters:
  • path (str) – path to write logs to
  • steps_before_flushing – (int, optional): Number of steps to store in log before flushing
  • log_all_ranks – (bool, optional): Log all ranks if true, else log only on rank 0.
__init__(path: str, steps_before_flushing: int = 100, log_all_ranks: bool = False) None

Methods

__init__(path[, steps_before_flushing, ...])
close() Close log resource, flushing if necessary.
flush()
log(name, data, step) Log scalar data to file.
log_dict(payload, step) Add multiple scalar values.

Attributes

path

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources