code: def median(
      input: ivy.Array,
      /,
      *,
      axis: Optional[Union[Tuple[int], int]] = None,
      keepdims: bool = False,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Compute the median along the specified axis.
  
      Parameters
      ----------
      input
          Input array.
      axis
          Axis or axes along which the medians are computed. The default is to compute
          the median along a flattened version of the array.
      keepdims
          If this is set to True, the axes which are reduced are left in the result
          as dimensions with size one.
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          The median of the array elements.
  
      Examples
      --------
      >>> a = ivy.array([[10, 7, 4], [3, 2, 1]])
      >>> ivy.median(a)
      3.5
      >>> ivy.median(a, axis=0)
      ivy.array([6.5, 4.5, 2.5])
      """
      return ivy.current_backend().median(
          input, axis=axis, keepdims=keepdims, out=out
      )
  
file_path: ivy/ivy/functional/ivy/experimental/statistical.py
imports: from typing import Optional, Union, Tuple, Sequence
  import ivy
  from ivy.func_wrapper import handle_array_function, handle_out_argument, to_native_arrays_and_back, handle_array_like_without_promotion, handle_nestable, infer_dtype, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 2 for calling a global function with example usage: median() and returns: ivy