code: def accuracy(pred, target):
      y = np.argmax(pred, axis=1)
      t = np.argmax(target, axis=1)
      a = y == t
      return np.array(a, "int").sum()
  
imports: from singa import singa_wrap
  from singa import autograd
  from singa import tensor
  from singa import device
  from singa import opt
  from PIL import Image
  import numpy
  import os
  import sys
  import time
label_desc: Use image node_id 8 for calling a global function with example usage: accuracy(pred, target) and returns: np