code: def evaluate_on_cifar10(
      model, gpu=False, debug=False, batch_size=64, num_workers=6
  ):
      CIFAR_MEAN = [0.49139968, 0.48215827, 0.44653124]
      CIFAR_STD = [0.24703233, 0.24348505, 0.26158768]
  
      dataset = CIFAR10(
          root="data/cifar10",
          train=False,
          download=True,
          transform=transforms.Compose(
              [
                  transforms.ToTensor(),
                  transforms.Normalize(CIFAR_MEAN, CIFAR_STD),
              ]
          ),
      )
  
      subset = np.random.permutation(len(dataset))
  
      if debug:
          subset = subset[:200]
  
      dataloader = DataLoader(
          dataset,
          batch_size=batch_size,
          num_workers=num_workers,
          sampler=SubsetRandomSampler(subset),
      )
      model.eval()
      with torch.no_grad():
          correct = total = 0
          pbar = tqdm.tqdm(dataloader, desc="Evaluating on CIFAR10")
          for inputs, targets in pbar:
              if gpu:
                  inputs, targets = inputs.cuda(), targets.cuda()
              logits = model(inputs)
              _, predict = torch.max(logits, 1)
              correct += (predict == targets).cpu().sum().item()
              total += targets.size(0)
              pbar.set_postfix(
                  {
                      "correct": correct,
                      "total": total,
                      "acc": correct / total * 100,
                  }
              )
      print("Overall accuracy (top-1):", correct / total * 100)
      return correct / total
  
file_path: nni/test/algo/nas/hub/test_pretrained.py
imports: import os
  import numpy
  import torch
  import tqdm
  import PIL
  from torch.utils.data import SubsetRandomSampler, DataLoader
  from torchvision import transforms
  from torchvision.datasets import ImageNet, CIFAR10
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate_on_cifar10(model, gpu, debug, batch_size, num_workers) and returns: unknown