Skip to content

Commit 7971b3b

Browse files
Move is_type_supported() to dpnp_iface_random.py and remove from public API
1 parent 2bbd6de commit 7971b3b

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

dpnp/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@
262262
iinfo,
263263
isdtype,
264264
issubdtype,
265-
is_type_supported,
266265
)
267266
from .dpnp_iface_manipulation import can_cast, result_type
268267
from .dpnp_iface_types import dtype
@@ -760,7 +759,6 @@
760759
"iinfo",
761760
"isdtype",
762761
"issubdtype",
763-
"is_type_supported",
764762
"result_type",
765763
]
766764

dpnp/dpnp_iface_types.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,3 @@ def issubdtype(arg1, arg2):
311311
"""
312312

313313
return numpy.issubdtype(arg1, arg2)
314-
315-
316-
def is_type_supported(obj_type):
317-
"""Return True if type is supported by DPNP python level."""
318-
319-
if obj_type in (float64, float32, int64, int32):
320-
return True
321-
return False

dpnp/random/dpnp_iface_random.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ def _get_random_state(device=None, sycl_queue=None):
6969
return _dpnp_random_states[sycl_queue]
7070

7171

72+
def _is_type_supported(obj_type):
73+
"""Return True if type is supported by dpnp.random"""
74+
75+
if obj_type in (dpnp.float64, dpnp.float32, dpnp.int64, dpnp.int32):
76+
return True
77+
return False
78+
79+
7280
def beta(a, b, size=None):
7381
"""
7482
Draw samples from a Beta distribution.
@@ -1587,7 +1595,7 @@ def shuffle(x1):
15871595
"Running on CUDA is currently not supported"
15881596
)
15891597

1590-
if not dpnp.is_type_supported(x1_desc.dtype):
1598+
if not _is_type_supported(x1_desc.dtype):
15911599
pass
15921600
else:
15931601
dpnp_rng_shuffle(x1_desc).get_pyobj()

0 commit comments

Comments
 (0)