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: Saves the PyTorch model (or models).
docstr_tok: ["Saves","the","PyTorch","model","(","or","models",")","."]
code: def _pytorch_simple_save(self, itr=None):
      """
      Saves the PyTorch model (or models).
      """
      if proc_id() == 0:
          assert hasattr(
              self, "pytorch_saver_elements"
          ), "First have to setup saving with self.setup_pytorch_saver"
          fpath = "pyt_save"
          fpath = osp.join(self.output_dir, fpath)
          fname = (
              "model" + ("%d" % itr if itr is not None else "") + ".pt"
          )
          fname = osp.join(fpath, fname)
          os.makedirs(fpath, exist_ok=True)
          with warnings.catch_warnings():
              warnings.simplefilter("ignore")
              # We are using a non-recommended way of saving PyTorch models,
              # by pickling whole objects (which are dependent on the exact
              # directory structure at the time of saving) as opposed to
              # just saving network weights. This works sufficiently well
              # for the purposes of Spinning Up, but you may want to do
              # something different for your personal PyTorch project.
              # We use a catch_warnings() context to avoid the warnings about
              # not being able to save the source code.
              torch.save(self.pytorch_saver_elements, fname)
  
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 9 for calling the Logger obj's underlying member method code with example usage: obj._pytorch_simple_save(itr) without return types