code: def var(
      x: torch.Tensor,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      correction: Union[int, float] = 0,
      keepdims: bool = False,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      if axis is None:
          axis = list(range(len(x.shape)))
      if axis == ():
          return x
      axis = (axis,) if isinstance(axis, int) else tuple(axis)
      if correction == 0:
          return torch.var(
              x, dim=axis, unbiased=False, keepdim=keepdims
          )
      elif correction == 1:
          return torch.var(x, dim=axis, unbiased=True, keepdim=keepdims)
      size = 1
      for a in axis:
          size *= x.shape[a]
      if size - correction <= 0:
          ret = torch.var(x, dim=axis, unbiased=False, keepdim=keepdims)
          ret = ivy.full(ret.shape, float("nan"), dtype=ret.dtype)
          return ret
      else:
          return torch.mul(
              torch.var(x, dim=axis, unbiased=False, keepdim=keepdims),
              (size / (size - correction)),
          ).to(x.dtype)
  
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 8 for calling a global function with example usage: var() and returns: x, torch, ret, torch, torch