code: def max(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      keepdims: bool = False,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Calculate the maximum value of the input array ``x``.
  
      .. note::
         When the number of elements over which to compute the maximum value is zero, the
         maximum value is implementation-defined. Specification-compliant libraries may
         choose to raise an error, return a sentinel value (e.g., if ``x`` is a
         floating-point input array, return ``NaN``), or return the minimum possible
         value for the input array ``x`` data type (e.g., if ``x`` is a floating-point
         array, return ``-infinity``).
  
      **Special Cases**
  
      For floating-point operands,
  
      -   If ``x_i`` is ``NaN``, the maximum value is ``NaN`` (i.e., ``NaN`` values
          propagate).
  
      Parameters
      ----------
      x
          input array. Should have a numeric data type.
      axis
          axis or axes along which maximum values must be computed. By default, the
          maximum value must be computed over the entire array. If a tuple of integers,
          maximum values must be computed over multiple axes. Default: ``None``.
      keepdims
          if ``True``, the reduced axes (dimensions) must be included in the result as
          singleton dimensions, and, accordingly, the result must be compatible with the
          input array (see :ref:`broadcasting`). Otherwise, if ``False``, the reduced axes
          (dimensions) must not be included in the result. Default: ``False``.
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          if the maximum value was computed over the entire array, a zero-dimensional
          array containing the maximum value; otherwise, a non-zero-dimensional array
          containing the maximum values. The returned array must have the same data type
          as ``x``.
  
  
      This method conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      API_specification/generated/array_api.max.html>`_
      in the standard.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([1, 2, 3])
      >>> z = ivy.max(x)
      >>> print(z)
      ivy.array(3)
  
      >>> x = ivy.array([0, 1, 2])
      >>> z = ivy.array(0)
      >>> y = ivy.max(x, out=z)
      >>> print(z)
      ivy.array(2)
  
      >>> x = ivy.array([[0, 1, 2], [4, 6, 10]])
      >>> y = ivy.max(x, axis=0, keepdims=True)
      >>> print(y)
      ivy.array([[4, 6, 10]])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([0., 1., 2.]), b=ivy.array([3., 4., 5.]))
      >>> y = ivy.max(x)
      >>> print(y)
      {
          a: ivy.array(2.),
          b: ivy.array(5.)
      }
  
      >>> x = ivy.Container(a=ivy.array([[1, 2, 3],[-1,0,2]]),
      ...                   b=ivy.array([[2, 3, 4], [0, 1, 2]]))
      >>> z = ivy.max(x, axis=1)
      >>> print(z)
      {
          a: ivy.array([3, 2]),
          b: ivy.array([4, 2])
      }
      """
      return current_backend(x).max(
          x, axis=axis, keepdims=keepdims, out=out
      )
  
file_path: ivy/ivy/functional/ivy/statistical.py
imports: from typing import Union, Optional, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 3 for calling a global function with example usage: max() and returns: current_backend