code: def argmax(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: Optional[int] = None,
      keepdims: bool = False,
      dtype: Optional[Union[ivy.Dtype, ivy.NativeDtype]] = None,
      select_last_index: bool = False,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the indices of the maximum values along a specified axis. When
      the maximum value occurs multiple times, only the indices corresponding to
      the first occurrence are returned.
  
      Parameters
      ----------
      x
          input array. Should have a numeric data type.
      axis
          axis along which to search. If None, the function must return the index of the
          maximum value of the flattened array. Default = None.
      keepdims
          If this is set to True, the axes which are reduced are left in the result as
          dimensions with size one. With this option, the result will broadcast correctly
          against the array.
      dtype
          Optional data type of the output array.
      select_last_index
          If this is set to True, the index corresponding to the
          last occurrence of the maximum value will be returned
      out
          If provided, the result will be inserted into this array. It should be of the
          appropriate shape and dtype.
  
      Returns
      -------
      ret
          if axis is None, a zero-dimensional array containing the index of the first
          occurrence of the maximum value; otherwise, a non-zero-dimensional array
          containing the indices of the maximum values. The returned array must have be
          the default array index data type.
  
  
      This function 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.argmax.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([-0., 1., -1.])
      >>> y = ivy.argmax(x)
      >>> print(y)
      ivy.array([1])
  
      >>> x = ivy.array([-0., 1., -1.])
      >>> ivy.argmax(x, out=x)
      >>> print(x)
      ivy.array([1])
  
      >>> x = ivy.array([[1., -0., -1.], [-2., 3., 2.]])
      >>> y = ivy.argmax(x, axis=1)
      >>> print(y)
      ivy.array([0, 1])
  
      >>> x = ivy.array([[4., 0., -1.], [2., -3., 6]])
      >>> y = ivy.argmax(x, axis=1, keepdims=True)
      >>> print(y)
      ivy.array([[0], [2]])
  
      >>> x = ivy.array([[4., 0., -1.], [2., -3., 6]])
      >>> y = ivy.argmax(x, axis=1, dtype=ivy.int64)
      >>> print(y, y.dtype)
      ivy.array([0, 2]) int64
  
      >>> x = ivy.array([[4., 0., -1.],[2., -3., 6], [2., -3., 6]])
      >>> z = ivy.zeros((1,3), dtype=ivy.int64)
      >>> y = ivy.argmax(x, axis=1, keepdims=True, out=z)
      >>> print(z)
      ivy.array([[0],[2],[2]])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([0., -1., 2.]), b=ivy.array([3., 4., 5.]))
      >>> y = ivy.argmax(x)
      >>> print(y)
      {
          a: ivy.array(2),
          b: ivy.array(2)
      }
      """
      return current_backend(x).argmax(
          x,
          axis=axis,
          keepdims=keepdims,
          dtype=dtype,
          select_last_index=select_last_index,
          out=out,
      )
  
file_path: ivy/ivy/functional/ivy/searching.py
imports: from numbers import Number
  from typing import Union, Optional, Tuple
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
  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
label_desc: Use image node_id 1 for calling a global function with example usage: argmax() and returns: current_backend