docstr: Save checkpoint of the whole model.
  Saving model weights and architecture weights as ```filename```,
  and saving currently chosen architecture in ```arch_path```.
docstr_tok: ["Save","checkpoint","of","the","whole","model",".","Saving","model","weights","and","architecture","weights","as","``","`","filename","``","`",",","and","saving","currently","chosen","architecture","in","``","`","arch_path","``","`","."]
code: def save_checkpoint(self, epoch, filename, choice_names=None):
      """
      Save checkpoint of the whole model.
      Saving model weights and architecture weights as ```filename```,
      and saving currently chosen architecture in ```arch_path```.
      """
      state = {
          "pfld_backbone": self.model.state_dict(),
          "auxiliarynet": self.auxiliarynet.state_dict(),
          "optim": self.model_optim.state_dict(),
          "epoch": epoch,
          "arch_sample": choice_names,
      }
      torch.save(state, filename)
      self.logger.info("Save checkpoint to {0:}".format(filename))
  
      if self.arch_path:
          self.export(self.arch_path)
  
file_path: nni/examples/nas/legacy/oneshot/pfld/lib/trainer.py
imports: from __future__ import absolute_import, division, print_function
  import os
  import time
  import torch
  import numpy
  from nni.algorithms.nas.pytorch.fbnet import FBNetTrainer
  from nni.nas.pytorch.utils import AverageMeter
  from .utils import accuracy
label_desc: Use image node_id 6 for calling the PFLDTrainer obj's underlying member method code with example usage: obj.save_checkpoint(epoch, filename, choice_names) without return types