code: def _process_metrics(graph, metrics, real_batch_size):
      import tensorflow as tf
  
      outputs = [real_batch_size]
      val_methods = None
      if metrics is not None:
          idx = 1
          val_methods = []
          for metric_name in metrics:
              metric = metrics[metric_name]
              if tf.is_numeric_tensor(metric):
                  outputs.append(metric)
                  val_methods.append(
                      StatelessMetric(metric_name, idx, 0)
                  )
                  idx += 1
              else:
                  outputs += metric.outputs
                  with graph.as_default():
                      val_labels = [
                          tf.identity(v) for v in metric.labels
                      ]
                  outputs += val_labels
                  method = TFValidationMethod(
                      metric.val_method,
                      metric_name,
                      list(range(idx, idx + len(metric.outputs))),
                      list(
                          range(
                              idx + len(metric.outputs),
                              idx
                              + len(metric.outputs)
                              + len(val_labels),
                          )
                      ),
                  )
                  val_methods.append(method)
                  idx += len(metric.outputs) + len(val_labels)
  
      outputs = [tf.to_float(output) for output in outputs]
      return outputs, val_methods
  
imports: import json
  import logging
  import os
  import sys
  import tempfile
  from bigdl.dllib.nn.criterion import Criterion
  from bigdl.dllib.nn.layer import Layer
  from bigdl.dllib.optim.optimizer import MaxEpoch, EveryEpoch
  from bigdl.dllib.utils.common import to_list, JavaValue
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.feature.common import FeatureSet
  from bigdl.dllib.keras.engine.topology import to_bigdl_metric, Loss, OptimMethod
  from bigdl.dllib.net.utils import find_placeholders, to_bigdl_optim_method, find_tensors
  from bigdl.dllib.estimator.estimator import Estimator
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.triggers import EveryEpoch
  from bigdl.dllib.utils.triggers import ZooTrigger
  from bigdl.orca.tfpark.tf_dataset import TFNdarrayDataset, check_data_compatible
  from bigdl.orca.tfpark.tf_dataset import _standarize_feature_label_dataset
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 5 for calling the TFModel obj's underlying member method code with example usage: obj._process_metrics(graph, metrics, real_batch_size) and returns: outputs,  val_methods