code: def accuracy(pred, target):
      # y is network output to be compared with ground truth (int)
      y = np.argmax(pred, axis=1)
      a = y == target
      correct = np.array(a, "int").sum()
      # print(correct)
      return correct
  
imports: import sys, os
  import json
  from singa import singa_wrap
  from singa import opt
  from singa import device
  from singa import tensor
  from singa import sonnx
  from singa import layer
  from singa import autograd
  import numpy
  import time
  import argparse
  from PIL import Image
  import onnx
  import logging
  from tqdm import tqdm
  from utils import download_model
label_desc: Use image node_id 2 for calling a global function with example usage: accuracy(pred, target) and returns: correct