code: def accuracy(output, target):
      batch_size = target.size(0)
      _, predicted = torch.max(output.data, 1)
      return (predicted == target).sum().item() / batch_size
  
file_path: nni/examples/nas/legacy/textnas/utils.py
imports: import logging
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling a global function with example usage: accuracy(output, target) and returns: unknown