cunumeric.amax#

cunumeric.amax(a: ndarray, axis: int | tuple[int, ...] | None = None, dtype: np.dtype[Any] | None = None, out: ndarray | None = None, keepdims: bool = False, initial: int | float | None = None, where: ndarray | None = None) ndarray#

Return the maximum of an array or maximum along an axis.

Parameters:
  • a (array_like) – Input data.

  • axis (None or int or tuple[int], optional) –

    Axis or axes along which to operate. By default, flattened input is used.

    If this is a tuple of ints, the maximum is selected over multiple axes, instead of a single axis or all the axes as before.

  • out (ndarray, optional) – Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. See ufuncs-output-type for more details.

  • keepdims (bool, optional) –

    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 input array.

    If the default value is passed, then keepdims will not be passed through to the amax method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.

  • initial (scalar, optional) – The minimum value of an output element. Must be present to allow computation on empty slice. See ~cunumeric.ufunc.reduce for details.

  • where (array_like[bool], optional) – Elements to compare for the maximum. See ~cunumeric.ufunc.reduce for details.

Returns:

amax – Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Return type:

ndarray or scalar

See also

numpy.amax

Availability:

Multiple GPUs, Multiple CPUs