code: def abs_error(predictions, labels, weights_fn=None):
      """Computes mean(abs(preds-target))."""
      del weights_fn  # Unused
      targets = tf.squeeze(labels, axis=[2, 3])
      batch_abs_error = tf.abs(predictions - targets)
      den = tf.ones(tf.shape(batch_abs_error), dtype=tf.float32)
      return (batch_abs_error, den)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import rouge
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 4 for calling a global function with example usage: abs_error(predictions, labels, weights_fn) and returns: batch_abs_error,  den