code: def log_softmax(
      x: np.ndarray,
      /,
      *,
      axis: Optional[int] = -1,
      complex_mode: Literal["split", "magnitude", "jax"] = "jax",
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      x_max = np.max(x, axis=axis, keepdims=True)
      sub_tmp = np.subtract(x, x_max)
      ret = np.sum(np.exp(sub_tmp), axis=axis, keepdims=True)
      ret = np.log(ret)
      ret = np.subtract(sub_tmp, ret)
      return ret
  
file_path: ivy/ivy/functional/backends/numpy/activations.py
imports: from typing import Optional, Union, Literal
  import numpy
  import ivy
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
label_desc: Use image node_id 8 for calling a global function with example usage: log_softmax() and returns: ret