code: def absolute_difference_error(
      output,
      target,
      is_mean=False,
      axis=-1,
      name="absolute_difference_error_loss",
  ):
      """Return the TensorFlow expression of absolute difference error (L1) of two batch of data.
  
      Parameters
      ----------
      output : Tensor
          2D, 3D or 4D tensor i.e. [batch_size, n_feature], [batch_size, height, width] or [batch_size, height, width, channel].
      target : Tensor
          The target distribution, format the same with `output`.
      is_mean : boolean
          Whether compute the mean or sum for each example.
              - If True, use ``tf.reduce_mean`` to compute the loss between one target and predict data.
              - If False, use ``tf.reduce_sum`` (default).
      axis : int or list of int
          The dimensions to reduce.
      name : str
          An optional name to attach to this function.
  
      """
      # # with tf.name_scope("absolute_difference_error_loss"):
      # if len(output.shape) == 2:  # [batch_size, n_feature]
      #     axis = 1
      # elif len(output.shape) == 3:  # [batch_size, w, h]
      #     axis = [1, 2]
      # elif len(output.shape) == 4:  # [batch_size, w, h, c]
      #     axis = [1, 2, 3]
      # else:
      #     raise Exception("Unknow dimension")
      if is_mean:
          loss = tf.reduce_mean(
              tf.reduce_mean(tf.abs(output - target), axis), name=name
          )
      else:
          loss = tf.reduce_mean(
              tf.reduce_sum(tf.abs(output - target), axis), name=name
          )
      return loss
  
imports: import numbers
  import tensorflow
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops, math_ops, nn_ops, standard_ops
  from tensorlayer import logging
label_desc: Use image node_id 6 for calling a global function with example usage: absolute_difference_error(output, target, is_mean, axis, name) and returns: loss