Skip to content

Commit 3cf7445

Browse files
committed
Add type hints to isin
1 parent e917751 commit 3cf7445

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpctl/tensor/_set_functions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
from typing import NamedTuple
17+
from typing import NamedTuple, Optional, Union
1818

1919
import dpctl.tensor as dpt
2020
import dpctl.utils as du
@@ -639,7 +639,13 @@ def unique_all(x: dpt.usm_ndarray) -> UniqueAllResult:
639639
)
640640

641641

642-
def isin(x, test_elements, /, *, invert=False):
642+
def isin(
643+
x: Union[dpt.usm_ndarray, int, float, complex, bool],
644+
test_elements: Union[dpt.usm_ndarray, int, float, complex, bool],
645+
/,
646+
*,
647+
invert: Optional[bool] = False,
648+
) -> dpt.usm_ndarray:
643649
"""
644650
Tests `x in test_elements` for each element of `x`. Returns a boolean array
645651
with the same shape as `x` that is `True` where the element is in

0 commit comments

Comments
 (0)