We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6318af3 commit b2e3634Copy full SHA for b2e3634
dpnp/tests/helper.py
@@ -161,6 +161,20 @@ def get_all_dtypes(
161
return dtypes
162
163
164
+def get_array(xp, a):
165
+ """
166
+ Cast input array `a` to a type supported by `xp` initerface.
167
+
168
+ Implicit conversion of either DPNP or DPCTL array to a NumPy array is not
169
+ allowed. Input array has to be explicitly casted with `asnumpy` function.
170
171
172
173
+ if xp is numpy and dpnp.is_supported_array_type(a):
174
+ return dpnp.asnumpy(a)
175
+ return a
176
177
178
def generate_random_numpy_array(
179
shape,
180
dtype=None,
0 commit comments