dpnp.tensor.isin

dpnp.tensor.isin(x: usm_ndarray | int | float | complex | bool, test_elements: usm_ndarray | int | float | complex | bool, /, *, invert: bool | None = False) usm_ndarray[source]

Tests x in test_elements for each element of x. Returns a boolean array with the same shape as x that is True where the element is in test_elements, False otherwise.

Parameters:
  • x ({usm_ndarray, bool, int, float, complex}) -- Input element or elements.

  • test_elements ({usm_ndarray, bool, int, float, complex}) -- Elements against which to test each value of x.

  • invert (bool, optional) --

    If True, the output results are inverted, i.e., are equivalent to testing x not in test_elements for each element of x.

    Default: False.

Returns:

out -- An array of the inclusion test results. The returned array has a boolean data type and the same shape as x.

Return type:

usm_ndarray