code: def softmax(
      x: torch.Tensor,
      /,
      *,
      axis: Optional[int] = None,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      if axis is None:
          axis = -1
      if torch.is_complex(x):
          amax = torch_backend.max(x, axis=axis, keepdims=True)
          exp_x = torch.exp(torch.subtract(x, amax))
          return torch.divide(
              exp_x, torch.sum(exp_x, dim=axis, keepdim=True)
          )
      return torch.nn.functional.softmax(x, axis)
  
file_path: ivy/ivy/functional/backends/torch/activations.py
imports: from typing import Optional, Union, Literal
  import numpy
  import torch
  import torch.nn
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  import ivy.functional.backends.torch
label_desc: Use image node_id 5 for calling a global function with example usage: softmax() and returns: torch, torch