original_docstring: Saves the model and the optimizer.
  
          Args:
              save_dir: absolute path to saving dir.
          
docstring: Saves the model and the optimizer.
docstring_tokens: Saves the model and the optimizer .
code: def save(self, save_dir):
          """Saves the model and the optimizer.
  
          Args:
              save_dir: absolute path to saving dir.
          """
  
          file_name = os.path.join(save_dir, "model.p")
          torch.save(self.state_dict(), file_name)
  
          file_name = os.path.join(save_dir, "optim.p")
          torch.save(self.optimizer.state_dict(), file_name)
code_tokens: def save ( self , save_dir ) : file_name = os . path . join ( save_dir , "model.p" ) torch . save ( self . state_dict ( ) , file_name ) file_name = os . path . join ( save_dir , "optim.p" ) torch . save ( self . optimizer . state_dict ( ) , file_name )
short_docstring: Saves the model and the optimizer.
short_docstring_tokens: Saves the model and the optimizer .
comment: """Saves the model and the optimizer.
  
          Args:
              save_dir: absolute path to saving dir.
          """