dpctl.tensor.isin

dpctl.tensor.isin(x, test_elements, /, *, invert=False)[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 (Union[usm_ndarray, bool, int, float, complex]) – input element or elements.

  • test_elements (Union[usm_ndarray, bool, int, float, complex]) – elements against which to test each value of x.

  • invert (Optional[bool]) – 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:

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