code: def save_checkpoint(model, auxiliarynet, optimizer, filename, logger):
      """Save checkpoint of the whole model."""
      state = {
          "pfld_backbone": model.state_dict(),
          "auxiliarynet": auxiliarynet.state_dict(),
          "optim": optimizer.state_dict(),
      }
      torch.save(state, filename)
      logger.info("Save checkpoint to {0:}".format(filename))
  
file_path: nni/examples/nas/legacy/oneshot/pfld/retrain.py
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import logging
  import os
  import time
  import torch
  import torchvision
  import numpy
  from datasets import PFLDDatasets
  from lib.builder import search_space
  from lib.ops import PRIMITIVES
  from lib.utils import PFLDLoss, accuracy
  from nni.algorithms.nas.pytorch.fbnet import LookUpTable, NASConfig, supernet_sample
  from nni.nas.pytorch.utils import AverageMeter
  from torch.utils.data import DataLoader
label_desc: Use image node_id 3 for calling a global function with example usage: save_checkpoint(model, auxiliarynet, optimizer, filename, logger) without return types