Skip to content

Commit 08094dc

Browse files
authored
add dpnp.is_type_supported() (#800)
1 parent da2bd58 commit 08094dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dpnp/dpnp_iface_types.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"int64",
5252
"integer",
5353
"isscalar",
54+
"is_type_supported",
5455
"longcomplex",
5556
"nan",
5657
"newaxis",
@@ -86,3 +87,14 @@ def isscalar(obj):
8687
nan = numpy.nan
8788
newaxis = None
8889
void = numpy.void
90+
91+
92+
def is_type_supported(obj_type):
93+
"""
94+
Return True if type is supported by DPNP python level.
95+
"""
96+
97+
if obj_type == float64 or obj_type == float32 or obj_type == int64 or obj_type == int32:
98+
return True
99+
100+
return False

0 commit comments

Comments
 (0)