code: def mean(
      x: torch.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      keepdims: bool = False,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      if axis is None:
          num_dims = len(x.shape)
          axis = list(range(num_dims))
      if axis in [(), []]:
          if ivy.exists(out):
              return ivy.inplace_update(out, x)
          else:
              return x
      return torch.mean(x, dim=axis, keepdim=keepdims, out=out)
  
file_path: ivy/ivy/functional/backends/torch/statistical.py
imports: from typing import Union, Optional, Sequence
  import torch
  import ivy
  from ivy.functional.ivy.statistical import _get_promoted_type_of_operands
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
label_desc: Use image node_id 3 for calling a global function with example usage: mean() and returns: torch, ivy, x