parameters: (x)
docstring: Computes *∑<sub>i</sub> ||x<sub>i</sub>||<sub>1</sub>*, summing over all non-batch dimensions.
  
      Args:
          x: `Tensor` or `TensorLike`.
              For `TensorLike` objects, only value the sum over all value attributes is computed.
  
      Returns:
          loss: `Tensor`
docstring_summary: Computes *∑<sub>i</sub> ||x<sub>i</sub>||<sub>1</sub>*, summing over all non-batch dimensions.
docstring_tokens: Computes * ∑<sub > i< / sub > ||x<sub > i< / sub > ||<sub > 1< / sub > * summing over all non - batch dimensions .
function: def l1_loss(x) -> Tensor:
      """
      Computes *∑<sub>i</sub> ||x<sub>i</sub>||<sub>1</sub>*, summing over all non-batch dimensions.
  
      Args:
          x: `Tensor` or `TensorLike`.
              For `TensorLike` objects, only value the sum over all value attributes is computed.
  
      Returns:
          loss: `Tensor`
      """
      if isinstance(x, Tensor):
          return math.sum_(abs(x), x.shape.non_batch)
      elif isinstance(x, TensorLike):
          return sum([l1_loss(getattr(x, a)) for a in variable_values(x)])
      else:
          raise ValueError(x)
function_tokens: def l1_loss ( x ) -> Tensor : if isinstance ( x , Tensor ) : return math . sum_ ( abs ( x ) , x . shape . non_batch ) elif isinstance ( x , TensorLike ) : return sum ( [ l1_loss ( getattr ( x , a ) ) for a in variable_values ( x ) ] ) else : raise ValueError ( x )