code: def get_path_acc(model, path, val_loader, args, val_iters=50):
      prec1_m = AverageMeter()
      prec5_m = AverageMeter()
      with torch.no_grad():
          for batch_idx, (input, target) in enumerate(val_loader):
              if batch_idx >= val_iters:
                  break
              if not args.prefetcher:
                  input = input.cuda()
                  target = target.cuda()
  
              output = model(input, path)
              if isinstance(output, (tuple, list)):
                  output = output[0]
  
              # augmentation reduction
              reduce_factor = args.tta
              if reduce_factor > 1:
                  output = output.unfold(
                      0, reduce_factor, reduce_factor
                  ).mean(dim=2)
                  target = target[0 : target.size(0) : reduce_factor]
  
              prec1, prec5 = accuracy(output, target, topk=(1, 5))
  
              torch.cuda.synchronize()
  
              prec1_m.update(prec1.item(), output.size(0))
              prec5_m.update(prec5.item(), output.size(0))
  
      return (prec1_m.avg, prec5_m.avg)
  
file_path: nni/examples/nas/legacy/cream/lib/utils/util.py
imports: import sys
  import logging
  import torch
  import argparse
  import torch.nn
  from torch import optim
  from thop import profile, clever_format
  from timm.utils import *
  from lib.config import cfg
label_desc: Use image node_id 1 for calling a global function with example usage: get_path_acc(model, path, val_loader, args, val_iters) and returns: prec1_m,  prec5_m