cupynumeric.in1d#

cupynumeric.in1d(
ar1: Any,
ar2: Any,
assume_unique: bool = False,
invert: bool = False,
kind: Literal['sort', 'table'] | None = None,
) ndarray#

Test whether each element of this 1-D array is also present in a second array.

Parameters:
  • ar2 (array_like) – The values against which to test each value of ar1.

  • assume_unique (bool, optional) – If True, the input arrays are both assumed to be unique, which can speed up the calculation. Default is False.

  • invert (bool, optional) – If True, the values in the returned array are inverted (that is, False where an element of ar1 is in ar2 and True otherwise). Default is False.

  • kind ({None, 'sort', 'table'}, optional) – The algorithm to use. This will not affect the final result, but will affect the speed and memory use. The default, None, will select automatically based on memory considerations.

Returns:

in1d – The values ar1[in1d] are in ar2.

Return type:

ndarray, bool

See also

numpy.in1d

NumPy equivalent function

Availability:

Multiple GPUs, Multiple CPUs

Notes

When kind is None (default), the ‘sort’ algorithm is used to leverage GPU acceleration for optimal performance.