code: def sg_mae(tensor, opt):
      r
      assert opt.target is not None, 'target is mandatory.'
  
      # absolute error
      out = tf.identity(tf.abs(tensor - opt.target), 'mae')
  
      # add summary
      tf.sg_summary_loss(out, name=opt.name)
  
      return out
docs: r"""Returns absolute error between `tensor` and `target`.
      
      Args:
        tensor: A `Tensor`.
        opt:
          target: A `Tensor` with the same shape and dtype as `tensor`.
          name: A `string`. A name to display in the tensor board web UI.
        
      Returns:
        A `Tensor` of the same shape and dtype as `tensor` 
      
      For example,
      
      ```
      tensor = [[34, 11, 40], [13, 30, 42]]
      target = [[34, 10, 41], [14, 31, 40]]
      tensor.sg_mse(target=target) => [[ 0.  1.  1.]
                                       [ 1.  1.  2.]]
      ```