code: def sum(
      x: torch.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      dtype: Optional[torch.dtype] = None,
      keepdims: Optional[bool] = False,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      dtype = ivy.as_native_dtype(dtype)
      if dtype is None and not ivy.is_bool_dtype(x):
          dtype = x.dtype
      if axis == ():
          return x.type(dtype)
      axis = tuple(axis) if isinstance(axis, list) else axis
      if axis is None:
          return torch.sum(
              input=x, dim=(), dtype=dtype, keepdim=keepdims
          )
      return torch.sum(input=x, dim=axis, dtype=dtype, keepdim=keepdims)
  
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 7 for calling a global function with example usage: sum() and returns: torch, x, torch