class_docstr: A general-purpose logger.
  
  Makes it easy to save diagnostics, hyperparameter configurations, the 
  state of a training run, and the trained model.
docstr: Write all of the diagnostics from the current iteration.
  
  Writes both to stdout, and to the output file.
docstr_tok: ["Write","all","of","the","diagnostics","from","the","current","iteration",".","Writes","both","to","stdout",",","and","to","the","output","file","."]
code: def dump_tabular(self):
      """
      Write all of the diagnostics from the current iteration.
  
      Writes both to stdout, and to the output file.
      """
      if proc_id() == 0:
          vals = []
          key_lens = [len(key) for key in self.log_headers]
          max_key_len = max(15, max(key_lens))
          keystr = "%" + "%d" % max_key_len
          fmt = "| " + keystr + "s | %15s |"
          n_slashes = 22 + max_key_len
          print("-" * n_slashes)
          for key in self.log_headers:
              val = self.log_current_row.get(key, "")
              valstr = (
                  "%8.3g" % val if hasattr(val, "__float__") else val
              )
              print(fmt % (key, valstr))
              vals.append(val)
          print("-" * n_slashes, flush=True)
          if self.output_file is not None:
              if self.first_row:
                  self.output_file.write(
                      "\t".join(self.log_headers) + "\n"
                  )
              self.output_file.write("\t".join(map(str, vals)) + "\n")
              self.output_file.flush()
      self.log_current_row.clear()
      self.first_row = False
  
imports: import json
  import joblib
  import shutil
  import numpy
  import tensorflow
  import torch
  import os.path, time, atexit, os
  import warnings
  from spinup.utils.mpi_tools import proc_id, mpi_statistics_scalar
  from spinup.utils.serialization_utils import convert_json
label_desc: Use image node_id 10 for calling the Logger obj's underlying member method code with example usage: obj.dump_tabular() without return types