code: def mean(
      x: paddle.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      keepdims: bool = False,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      ret_dtype = x.dtype
      if paddle.is_complex(x):
          ret = paddle.complex(
              paddle.mean(x.real(), axis=axis, keepdim=keepdims),
              paddle.mean(x.imag(), axis=axis, keepdim=keepdims),
          )
      else:
          ret = paddle.mean(x, axis=axis, 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 = ret.squeeze()
      return ret.astype(ret_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 3 for calling a global function with example usage: mean() and returns: ret