:mod:`heat.array_api._searching_functions` ========================================== .. py:module:: heat.array_api._searching_functions Module Contents --------------- .. function:: argmax(x: heat.array_api._array_object.Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> heat.array_api._array_object.Array Returns 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. :param x: Input array. Must have a numeric data type. :type x: Array :param axis: Axis along which to search. If ``None``, the function returns the index of the maximum value of the flattened array. Default: ``None``. :type axis: Optional[int] :param keepdims: If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions. Otherwise, if ``False``, the reduced axes (dimensions) are not be included in the result. Default: ``False``. :type keepdims: bool .. function:: argmin(x: heat.array_api._array_object.Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> heat.array_api._array_object.Array Returns the indices of the minimum values along a specified axis. When the minimum value occurs multiple times, only the indices corresponding to the first occurrence are returned. :param x: Input array. Must have a numeric data type. :type x: Array :param axis: Axis along which to search. If ``None``, the function returns the index of the minimum value of the flattened array. Default: ``None``. :type axis: Optional[int] :param keepdims: If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions. Otherwise, if ``False``, the reduced axes (dimensions) are not be included in the result. Default: ``False``. :type keepdims: bool .. function:: nonzero(x: heat.array_api._array_object.Array, /) -> Tuple[heat.array_api._array_object.Array, Ellipsis] Returns the indices of the array elements which are non-zero. :param x: Input array. Must have a positive rank. :type x: Array .. function:: where(condition: heat.array_api._array_object.Array, x1: heat.array_api._array_object.Array, x2: heat.array_api._array_object.Array, /) -> heat.array_api._array_object.Array Returns elements chosen from ``x1`` or ``x2`` depending on ``condition``. :param condition: When ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2``. :type condition: Array :param x1: First input array. Must be compatible with ``condition`` and ``x2``. :type x1: Array :param x2: Second input array. Must be compatible with ``condition`` and ``x1``. :type x2: Array