Skip to content

Commit 3926f89

Browse files
committed
Use dpctl.tensor.nonzero() implementation
1 parent e2022e4 commit 3926f89

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dpnp/dpnp_iface_searching.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# distutils: language = c++
33
# -*- coding: utf-8 -*-
44
# *****************************************************************************
5-
# Copyright (c) 2016-2020, Intel Corporation
5+
# Copyright (c) 2016-2023, Intel Corporation
66
# All rights reserved.
77
#
88
# Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,9 @@
4444
from dpnp.dpnp_utils import *
4545

4646
import dpnp
47+
4748
import numpy
49+
import dpctl.tensor as dpt
4850

4951

5052
__all__ = [
@@ -218,7 +220,9 @@ def where(condition, x=None, y=None, /):
218220
if missing == 1:
219221
raise ValueError("Must provide both 'x' and 'y' or neither.")
220222
elif missing == 2:
221-
return dpnp.nonzero(condition)
223+
# TODO: rework through dpnp.nonzero() once ready
224+
return dpt.nonzero(dpt.asarray(condition))
225+
# return dpnp.nonzero(condition)
222226
elif missing == 0:
223227
# get USM type and queue to copy scalar from the host memory into a USM allocation
224228
usm_type, queue = get_usm_allocations([condition, x, y])

0 commit comments

Comments
 (0)