code: def accuracy(logits, labels):
      predictions = tf.argmax(logits, axis=1, output_type=labels.dtype)
      is_correct = tf.cast(
          tf.equal(predictions, labels), dtype=tf.float32
      )
      return tf.reduce_mean(is_correct)
  
file_path: analytics-zoo/pyzoo/zoo/examples/tensorflow/tfpark/tf_optimizer/train.py
imports: import tensorflow
  from zoo import init_nncontext
  from zoo.tfpark import TFOptimizer, TFDataset
  from bigdl.optim.optimizer import *
  import numpy
  import sys
  from bigdl.dataset import mnist
  from bigdl.dataset.transformer import *
  from nets import lenet
label_desc: Use image node_id 1 for calling a global function with example usage: accuracy(logits, labels) and returns: tf