code: def cumprod(
      x: np.ndarray,
      /,
      *,
      axis: int = 0,
      exclusive: bool = False,
      reverse: bool = False,
      dtype: Optional[np.dtype] = None,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      if dtype is None:
          dtype = _infer_dtype(x.dtype)
      if not (exclusive or reverse):
          return np.cumprod(x, axis, dtype=dtype, out=out)
      elif exclusive and reverse:
          x = np.cumprod(np.flip(x, axis=axis), axis=axis, dtype=dtype)
          x = np.swapaxes(x, axis, -1)
          x = np.concatenate(
              (np.ones_like(x[..., -1:]), x[..., :-1]), -1
          )
          x = np.swapaxes(x, axis, -1)
          return np.flip(x, axis=axis)
      elif exclusive:
          x = np.swapaxes(x, axis, -1)
          x = np.concatenate(
              (np.ones_like(x[..., -1:]), x[..., :-1]), -1
          )
          x = np.cumprod(x, -1, dtype=dtype)
          return np.swapaxes(x, axis, -1)
      elif reverse:
          x = np.cumprod(np.flip(x, axis=axis), axis=axis, dtype=dtype)
          return np.flip(x, axis=axis)
  
file_path: ivy/ivy/functional/backends/numpy/statistical.py
imports: import numpy
  from typing import Union, Optional, Sequence
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
  from .None import backend_version
  from ivy.utils.einsum_parser import legalise_einsum_expr
label_desc: Use image node_id 9 for calling a global function with example usage: cumprod() and returns: np, np, np, np