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()
      return correct
  
imports: from singa import singa_wrap
  from singa import device
  from singa import tensor
  from singa import opt
  from singa import autograd
  from singa.opt import Optimizer
  from singa.opt import DecayScheduler
  from singa.opt import Constant
  import numpy
  import time
  import argparse
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: accuracy(pred, target) and returns: correct