code: def median(
      input: np.ndarray,
      /,
      *,
      axis: Optional[Union[Tuple[int], int]] = None,
      keepdims: bool = False,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      if out is not None:
          out = np.reshape(out, input.shape)
      ret = np.median(
          input,
          axis=axis,
          keepdims=keepdims,
          out=out,
      )
      if input.dtype in [np.uint64, np.int64, np.float64]:
          return ret.astype(np.float64)
      elif input.dtype in [np.float16]:
          return ret.astype(input.dtype)
      else:
          return ret.astype(np.float32)
  
imports: from typing import Optional, Union, Tuple, Sequence
  import numpy
  import math
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ..statistical import _infer_dtype
  from copy import deepcopy
label_desc: Use image node_id 2 for calling a global function with example usage: median() and returns: ret, ret, ret