code: def eval(
      sess_config,
      input_hooks,
      model,
      data_init_op,
      steps,
      checkpoint_dir,
  ):
      model.is_training = False
      hooks = []
      hooks.extend(input_hooks)
  
      scaffold = tf.train.Scaffold(
          local_init_op=tf.group(
              tf.local_variables_initializer(), data_init_op
          )
      )
      session_creator = tf.train.ChiefSessionCreator(
          scaffold=scaffold,
          checkpoint_dir=checkpoint_dir,
          config=sess_config,
      )
      writer = tf.summary.FileWriter(
          os.path.join(checkpoint_dir, "eval")
      )
      merged = tf.summary.merge_all()
      with tf.train.MonitoredSession(
          session_creator=session_creator, hooks=hooks
      ) as sess:
          for _in in range(1, steps + 1):
              if _in != steps:
                  sess.run([model.acc_op, model.auc_op])
                  if _in % 1000 == 0:
                      print(
                          "Evaluation complete:[{}/{}]".format(
                              _in, steps
                          )
                      )
              else:
                  eval_acc, eval_auc, events = sess.run(
                      [model.acc_op, model.auc_op, merged]
                  )
                  writer.add_summary(events, _in)
                  print(
                      "Evaluation complete:[{}/{}]".format(_in, steps)
                  )
                  print("ACC = {}\nAUC = {}".format(eval_acc, eval_auc))
  
      return eval_acc, eval_auc
  
imports: import time
  import argparse
  import tensorflow
  import os
  import sys
  import math
  import collections
  from tensorflow.python.client import timeline
  import json
  from tensorflow.python.ops import partitioned_variables
  import ray
  from bigdl.dllib.utils.log4Error import *
  from bigdl.orca import init_orca_context, stop_orca_context, OrcaContext
  from bigdl.orca.data.utils import process_spark_xshards
  from bigdl.orca.learn.utils import maybe_dataframe_to_xshards
  from bigdl.friesian.feature import FeatureTable
label_desc: Use image node_id 3 for calling a global function with example usage: eval(sess_config, input_hooks, model, data_init_op, steps, checkpoint_dir) and returns: eval_acc,  eval_auc