class_docstr: base class for classfication 
docstr: lables: [batch]
  logits: [batch, num_classes]
docstr_tok: ["lables",":","[","batch","]","logits",":","[","batch",",","num_classes","]"]
code: def get_eval_hooks(self, labels, logits):
      """lables: [batch]
      logits: [batch, num_classes]
      """
      nclass = self.config["data"]["task"]["classes"]["num"]
  
      eval_hooks = []
      metric_tensor = {}
      with tf.variable_scope("metrics"):
          true_label = labels
          true_label_bool = tf.cast(labels, tf.bool)
          softmax = tf.nn.softmax(logits)
          pred_label = tf.argmax(softmax, -1)
          eval_metrics_ops = {
              "accuracy": tf.metrics.accuracy(
                  labels=true_label,
                  predictions=pred_label,
                  weights=None,
              ),
          }
          if nclass == 2:
              eval_metrics_ops.update(
                  {
                      "auc": tf.metrics.auc(
                          labels=true_label,
                          predictions=softmax[:, -1],
                          num_thresholds=20,
                          curve="ROC",
                          summation_method="trapezoidal",
                      ),
                      "precision": tf.metrics.precision(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "recall": tf.metrics.recall(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "tp": tf.metrics.true_positives(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "fn": tf.metrics.false_negatives(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "fp": tf.metrics.false_positives(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "tn": tf.metrics.true_negatives(
                          labels=true_label,
                          predictions=pred_label,
                          weights=None,
                      ),
                      "pr_curve_eval": pr_summary.streaming_op(
                          name="pr_curve_eval",
                          labels=true_label_bool,
                          predictions=softmax[:, -1],
                          num_thresholds=50,
                          weights=None,
                      ),
                  }
              )
  
      metric_tensor.update(
          {key: val[0] for key, val in eval_metrics_ops.items()}
      )
      metric_hook = tf.train.LoggingTensorHook(
          tensors=metric_tensor,
          every_n_iter=100,
          every_n_secs=None,
          at_end=False,
          formatter=None,
      )
      eval_hooks.append(metric_hook)
      return eval_hooks, eval_metrics_ops
  
imports: import os
  import re
  import functools
  import collections
  from absl import logging
  import delta.compat
  from tensorflow.python import debug
  from tensorflow.python.estimator.canned import metric_keys
  from tensorboard.plugins.pr_curve import summary
  from delta import utils
  from delta.utils.hparam import HParams
  from delta.utils import metrics
  from delta.utils import summary
  from delta.utils.register import registers
  from delta.utils.solver.base_solver import ABCEstimatorSolver
label_desc: Use image node_id 10 for calling the EstimatorSolver obj's underlying member method code with example usage: obj.get_eval_hooks(labels, logits) and returns: eval_hooks,  eval_metrics_ops