code: def evaluate_acc(class_cls, criterion, args):
      model = class_cls()
      with original_state_dict_hooks(model):
          model.load_state_dict(
              load_and_parse_state_dict(args.checkpoint), strict=False
          )
      model.cuda()
  
      if args.spos_preprocessing:
          train_trans = transforms.Compose(
              [
                  transforms.RandomResizedCrop(224),
                  transforms.ColorJitter(
                      brightness=0.4, contrast=0.4, saturation=0.4
                  ),
                  transforms.RandomHorizontalFlip(0.5),
                  ToBGRTensor(),
              ]
          )
      else:
          train_trans = transforms.Compose(
              [transforms.RandomResizedCrop(224), transforms.ToTensor()]
          )
      val_trans = transforms.Compose(
          [transforms.RandomResizedCrop(224), ToBGRTensor()]
      )
      train_dataset = datasets.ImageNet(
          args.imagenet_dir, split="train", transform=train_trans
      )
      val_dataset = datasets.ImageNet(
          args.imagenet_dir, split="val", transform=val_trans
      )
  
      train_loader = torch.utils.data.DataLoader(
          train_dataset,
          batch_size=args.train_batch_size,
          num_workers=args.workers,
          shuffle=True,
      )
      test_loader = torch.utils.data.DataLoader(
          val_dataset,
          batch_size=args.test_batch_size,
          num_workers=args.workers,
          shuffle=True,
      )
  
      acc_before = test_acc(
          model, criterion, args.log_frequency, test_loader
      )
      nni.report_intermediate_result(acc_before)
  
      retrain_bn(
          model,
          criterion,
          args.train_iters,
          args.log_frequency,
          train_loader,
      )
      acc = test_acc(model, criterion, args.log_frequency, test_loader)
      assert isinstance(acc, float)
      nni.report_intermediate_result(acc)
      nni.report_final_result(acc)
  
imports: import time
  import json
  import random
  import logging
  import argparse
  import numpy
  import torch
  import torchvision.transforms
  import torchvision.datasets
  import nni
  from nn_meter import load_latency_predictor
  import nni.retiarii.nn.pytorch
  import nni.retiarii.strategy
  from nni.retiarii.evaluator.functional import FunctionalEvaluator
  from nni.retiarii.utils import original_state_dict_hooks
  from nni.retiarii.oneshot.pytorch.utils import AverageMeterGroup
  from nni.retiarii.experiment.pytorch import RetiariiExeConfig, RetiariiExperiment
  from network import ShuffleNetV2OneShot, load_and_parse_state_dict
  from utils import CrossEntropyLabelSmooth, accuracy, ToBGRTensor, get_archchoice_by_model
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate_acc(class_cls, criterion, args) without return types