code: def max(
      x: torch.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      keepdims: bool = False,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      if torch.is_complex(x):
          const = torch.tensor(1j, device=x.device, dtype=x.dtype)
          real_max = torch.max(
              x.real, dim=axis, keepdim=keepdims
          ).values
          min_val = torch.finfo(x.real.dtype).min
          imag = torch.where(x.real == real_max, x.imag, min_val)
          # we consider the number with the biggest real and imag part
          img_max = torch.max(imag, dim=axis, keepdim=keepdims).values
          img_max = img_max.to(x.dtype)
          return torch.add(
              real_max.to(x.dtype), torch.multiply(img_max, const)
          )
      if axis == ():
          if ivy.exists(out):
              return ivy.inplace_update(out, x)
          else:
              return x
      if not keepdims and not axis and axis != 0:
          return torch.amax(input=x, out=out)
      return torch.amax(input=x, dim=axis, keepdim=keepdims, out=out)
  
file_path: ivy/ivy/functional/backends/torch/statistical.py
imports: from typing import Union, Optional, Sequence
  import torch
  import ivy
  from ivy.functional.ivy.statistical import _get_promoted_type_of_operands
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
label_desc: Use image node_id 2 for calling a global function with example usage: max() and returns: torch, torch, torch, ivy, x