code: def log_softmax(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: Optional[int] = None,
      complex_mode: Literal["split", "magnitude", "jax"] = "jax",
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Apply the log_softmax function element-wise.
  
      Parameters
      ----------
      x
          Input array.
      axis
          The dimension log_softmax would be performed on. The default is ``None``.
      complex_mode
          optional specifier for how to handle complex data types. See
          ``ivy.func_wrapper.handle_complex_input`` for more detail.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          The output array with log_softmax applied element-wise to input.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([-1.0, -0.98])
      >>> y = ivy.log_softmax(x)
      >>> print(y)
      ivy.array([-0.703, -0.683])
  
      >>> x = ivy.array([1.0, 2.0, 3.0])
      >>> y = ivy.log_softmax(x)
      >>> print(y)
      ivy.array([-2.41, -1.41, -0.408])
  
      With :class:`ivy.NativeArray` input:
  
      >>> x = ivy.native_array([1.5, 0.5, 1.0])
      >>> y = ivy.log_softmax(x)
      >>> print(y)
      ivy.array([-0.68, -1.68, -1.18])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([1.5, 0.5, 1.0]))
      >>> y = ivy.log_softmax(x)
      >>> print(y)
      {
          a: ivy.array([-0.68, -1.68, -1.18])
      }
  
      >>> x = ivy.Container(a=ivy.array([1.0, 2.0]), b=ivy.array([0.4, -0.2]))
      >>> y = ivy.log_softmax(x)
      >>> print(y)
      {
          a: ivy.array([-1.31, -0.313]),
          b: ivy.array([-0.437, -1.04])
      }
      """
      return current_backend(x).log_softmax(x, axis=axis, out=out)
  
imports: from typing import Union, Optional, Callable, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_complex_input, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 5 for calling a global function with example usage: log_softmax() and returns: current_backend