code: def build_eval_step_fn(model, metrics, attack_fn):
      """Builds a compiled tf.function for evaluating the model for one step.
  
      Args:
        model: A Keras Model object which makes inference on input.
        metrics: A list of Keras Metric objects to be updated during evaluation.
        attack_fn: A callable built by build_attack_fn.
  
      Returns:
        A compiled tf.function which evaluates the model for one step.
      """
  
      @tf.function
      def eval_step(x, y):
          # Forward pass
          adv_x = attack_fn(x, y)
          logits = model(adv_x)
          for metric in metrics:
              metric.update_state(y, logits)
          return logits
  
      return eval_step
  
file_path: neural-structured-learning/research/multi_representation_adversary/multi_representation_adversary/helper.py
imports: from absl import logging
  from multi_representation_adversary import attacks
  from multi_representation_adversary import transforms
  import tensorflow.compat.v2
label_desc: Use image node_id 3 for calling a global function with example usage: build_eval_step_fn(model, metrics, attack_fn) and returns: eval_step, logits