code: def accuracy(output, target):
      batch_size = target.size(0)
      _, predicted = torch.max(output.data, 1)
      return {"acc1": (predicted == target).sum().item() / batch_size}
  
file_path: nni/examples/nas/legacy/notebooks/utils.py
imports: import os
  import torch
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from torchvision.datasets.utils import download_url
label_desc: Use image node_id 1 for calling a global function with example usage: accuracy(output, target) and returns: dict