code: def cummax(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: int = 0,
      exclusive: bool = False,
      reverse: bool = False,
      dtype: Optional[tf.DType] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Tuple[tf.Tensor, tf.Tensor]:
      if x.dtype in (tf.complex128, tf.complex64):
          x = tf.math.real(x)
  
      if exclusive or reverse:
          if exclusive and reverse:
              x, indices = __find_cummax(
                  tf.experimental.numpy.flip(x, axis=axis), axis=axis
              )
              x, indices = tf.experimental.numpy.swapaxes(
                  x, axis, -1
              ), tf.experimental.numpy.swapaxes(indices, axis, -1)
              x, indices = tf.experimental.numpy.concatenate(
                  (
                      tf.experimental.numpy.zeros_like(x[..., -1:]),
                      x[..., :-1],
                  ),
                  -1,
              ), tf.experimental.numpy.concatenate(
                  (
                      tf.experimental.numpy.zeros_like(
                          indices[..., -1:]
                      ),
                      indices[..., :-1],
                  ),
                  -1,
              )
              x, indices = tf.experimental.numpy.swapaxes(
                  x, axis, -1
              ), tf.experimental.numpy.swapaxes(indices, axis, -1)
              res, indices = tf.experimental.numpy.flip(
                  x, axis=axis
              ), tf.experimental.numpy.flip(indices, axis=axis)
          elif exclusive:
              x = tf.experimental.numpy.swapaxes(x, axis, -1)
              x = tf.experimental.numpy.concatenate(
                  (
                      tf.experimental.numpy.zeros_like(x[..., -1:]),
                      x[..., :-1],
                  ),
                  -1,
              )
              x = tf.experimental.numpy.swapaxes(x, axis, -1)
              res, indices = __find_cummax(x, axis=axis)
          elif reverse:
              x = tf.experimental.numpy.flip(x, axis=axis)
              x, indices = __find_cummax(x, axis=axis)
              res, indices = tf.experimental.numpy.flip(
                  x, axis=axis
              ), tf.experimental.numpy.flip(indices, axis=axis)
          return res, indices
  
      return __find_cummax(x, axis=axis)
  
imports: from typing import Union, Optional, Tuple, Sequence
  import tensorflow
  from tensorflow.python.ops.numpy_ops import np_math_ops
  import ivy
  from ivy import with_unsupported_dtypes, with_supported_dtypes, with_supported_device_and_dtypes
  from ..None import backend_version
  from copy import deepcopy
label_desc: Use image node_id 17 for calling a global function with example usage: cummax() and returns: __find_cummax, res,  indices