code: def cumsum(
      x: paddle.Tensor,
      axis: int = 0,
      exclusive: bool = False,
      reverse: bool = False,
      *,
      dtype: Optional[paddle.dtype] = None,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      dtype = dtype if dtype is not None else x.dtype
      x = paddle.cast(x, dtype)
      if not (exclusive or reverse):
          return paddle.cumsum(x, axis=axis).cast(dtype)
      elif exclusive and reverse:
          x = paddle.cumsum(
              paddle_backend.flip(x, axis=(axis,)), axis=axis
          )
          x = paddle_backend.swapaxes(x, axis, -1)
          x = paddle_backend.concat(
              [
                  paddle.zeros_like(
                      paddle_backend.get_item(
                          x, (..., slice(-1, None, None))
                      )
                  ),
                  paddle_backend.get_item(
                      x, (..., slice(None, -1, None))
                  ),
              ],
              axis=-1,
          )
          x = paddle_backend.swapaxes(x, axis, -1)
          return paddle_backend.flip(x, axis=(axis,)).cast(dtype)
      elif exclusive:
          x = paddle_backend.swapaxes(x, axis, -1)
          x = paddle_backend.concat(
              [
                  paddle.zeros_like(
                      paddle_backend.get_item(
                          x, (..., slice(-1, None, None))
                      )
                  ),
                  paddle_backend.get_item(
                      x, (..., slice(None, -1, None))
                  ),
              ],
              axis=-1,
          )
          x = paddle.cumsum(x, -1)
          return paddle_backend.swapaxes(x, axis, -1).cast(dtype)
      else:
          x = paddle.cumsum(
              paddle_backend.flip(x, axis=(axis,)), axis=axis
          )
          return paddle_backend.flip(x, axis=axis).cast(dtype)
  
file_path: ivy/ivy/functional/backends/paddle/statistical.py
imports: from typing import Union, Optional, Sequence
  import paddle
  import ivy
  from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes, with_supported_device_and_dtypes
  import ivy.functional.backends.paddle
  from ivy.utils.einsum_parser import legalise_einsum_expr
  from .None import backend_version
label_desc: Use image node_id 10 for calling a global function with example usage: cumsum(x, axis, exclusive, reverse) and returns: paddle, paddle_backend, paddle_backend, paddle_backend