code: def cummax(
      x: torch.Tensor,
      /,
      *,
      axis: int = 0,
      exclusive: bool = False,
      reverse: bool = False,
      dtype: Optional[torch.dtype] = None,
      out: Optional[torch.Tensor] = None,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      if exclusive or reverse:
          if exclusive and reverse:
              x1, x2 = torch.cummax(torch.flip(x, dims=(axis,)), axis)
              x1, x2 = torch.transpose(x1, axis, -1), torch.transpose(
                  x2, axis, -1
              )
              x1, x2 = torch.concat(
                  (torch.zeros_like(x1[..., -1:]), x1[..., :-1]), -1
              ), torch.concat(
                  (torch.zeros_like(x2[..., -1:]), x2[..., :-1]), -1
              )
              x1, x2 = torch.transpose(x1, axis, -1), torch.transpose(
                  x2, axis, -1
              )
              res1, res2 = torch.flip(x1, dims=(axis,)), torch.flip(
                  x2, dims=(axis,)
              )
          elif exclusive:
              x = torch.transpose(x, axis, -1)
              x = torch.cat(
                  (torch.zeros_like(x[..., -1:]), x[..., :-1]), -1
              )
              x1, x2 = torch.cummax(x, -1)
              res1, res2 = torch.transpose(
                  x1, axis, -1
              ), torch.transpose(x2, axis, -1)
          else:
              x1, x2 = torch.cummax(torch.flip(x, dims=(axis,)), axis)
              res1, res2 = torch.flip(x1, dims=(axis,)), torch.flip(
                  x2, dims=(axis,)
              )
          return res1, res2
  
      return torch.cummax(x, axis, out=out)
  
imports: from typing import Optional, Union, Tuple, Sequence
  import torch
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
  import ivy
  from ..statistical import _infer_dtype
  from copy import deepcopy
label_desc: Use image node_id 18 for calling a global function with example usage: cummax() and returns: torch, res1,  res2