code: def l1_loss(
      input: Union[ivy.Array, ivy.NativeArray],
      target: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      reduction: Optional[str] = "mean",
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """
      Compute L1 loss (Mean Absolute Error - MAE) between targeticted and input values.
  
      Parameters
      ----------
      input : Union[ivy.Array, ivy.NativeArray]
          Input array containing input values.
      target : Union[ivy.Array, ivy.NativeArray]
          Input array containing targeted values.
      reduction : str, optional
          Reduction method for the output loss. Options:
          "none" (no reduction), "mean" (mean of losses),
          "sum" (sum of losses). Default: "mean".
      out : Optional[ivy.Array], optional
          Optional output array for writing the result to.
          It must have a shape that the inputs broadcast to.
  
  
      Returns
      -------
      ivy.Array
          The L1 loss (MAE) between the given input and targeticted values.
  
  
      Examples
      --------
      >>> x = ivy.array([1.0, 2.0, 3.0])
      >>> y = ivy.array([0.5, 2.5, 2.0])
      >>> print(ivy.l1_loss(x, y))
      ivy.array(0.6)
      >>> a = ivy.array([[1.0, 2.0], [3.0, 4.0]])
      >>> b = ivy.array([[0.5, 1.5], [2.5, 3.5]])
      >>> print(ivy.l1_loss(a, b))
      ivy.array(0.5)
      """
      loss = ivy.abs(target - input)
  
      if reduction == "sum":
          return ivy.sum(loss, out=out)
      elif reduction == "mean":
          return ivy.mean(loss, out=out)
      else:
          return (
              ivy.inplace_update(out, loss) if out is not None else loss
          )
  
file_path: ivy/ivy/functional/ivy/experimental/losses.py
imports: from typing import Union, Optional
  import ivy
  from ivy.func_wrapper import handle_nestable, inputs_to_ivy_arrays, handle_array_like_without_promotion, handle_array_function, to_native_arrays_and_back
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 2 for calling a global function with example usage: l1_loss() and returns: ivy, ivy, unknown