cupy.unique_values#

cupy.unique_values(x)[source]#

Returns the unique elements of an input array x.

This function is Array API compatible alternative to:

>>> x = cupy.array([1, 1, 2])
>>> cupy.unique(x, equal_nan=False)
array([1, 2])
Parameters:

x (ndarray) – Input array. It will be flattened if it is not already 1-D.

Returns:

out – The unique elements of an input array.

Return type:

ndarray

See also

unique

Find the unique elements of an array.

numpy.unique_values