code: def sum(
      x: paddle.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      dtype: Optional[paddle.dtype] = None,
      keepdims: Optional[bool] = False,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      dtype = x.dtype if dtype is None else dtype
      dtype = ivy.as_ivy_dtype(dtype)
      ret = paddle.sum(x, axis=axis, dtype=dtype, keepdim=keepdims)
      # The following code is to simulate other frameworks
      # output shapes behaviour since min output dim is 1 in paddle
      if isinstance(axis, Sequence):
          if len(axis) == x.ndim:
              axis = None
      if (x.ndim == 1 or axis is None) and not keepdims:
          ret = paddle_backend.squeeze(ret, axis=-1)
      return ret
  
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 7 for calling a global function with example usage: sum() and returns: ret