1+ from __future__ import annotations
2+
13import numpy
24import pytest
35
46import dpnp as cupy
57from dpnp .tests .third_party .cupy import testing
68
7- pytest .skip ("UFunc interface is not supported" , allow_module_level = True )
8-
99
1010class C (cupy .ndarray ):
1111
@@ -20,6 +20,7 @@ def __array_finalize__(self, obj):
2020 self .info = getattr (obj , "info" , None )
2121
2222
23+ @pytest .mark .skip ("UFunc interface is not supported" )
2324class TestArrayUfunc :
2425
2526 @testing .for_all_dtypes ()
@@ -200,8 +201,8 @@ def test_types(self, xp, ufunc):
200201 sig
201202 for sig in types
202203 # CuPy does not support the following dtypes:
203- # (c)longdouble, datetime, timedelta, and object.
204- if not any (t in sig for t in "GgMmO " )
204+ # longlong, (c)longdouble, datetime, timedelta, and object.
205+ if not any (t in sig for t in "QqGgMmO " )
205206 )
206207 )
207208 return types
@@ -210,7 +211,7 @@ def test_types(self, xp, ufunc):
210211 def test_unary_out_tuple (self , xp ):
211212 dtype = xp .float64
212213 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
213- out = xp .zeros ((2 , 3 ), dtype )
214+ out = xp .zeros ((2 , 3 ), dtype = dtype )
214215 ret = xp .sin (a , out = (out ,))
215216 assert ret is out
216217 return ret
@@ -225,8 +226,8 @@ def test_unary_out_positional_none(self, xp):
225226 def test_binary_out_tuple (self , xp ):
226227 dtype = xp .float64
227228 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
228- b = xp .ones ((2 , 3 ), dtype )
229- out = xp .zeros ((2 , 3 ), dtype )
229+ b = xp .ones ((2 , 3 ), dtype = dtype )
230+ out = xp .zeros ((2 , 3 ), dtype = dtype )
230231 ret = xp .add (a , b , out = (out ,))
231232 assert ret is out
232233 return ret
@@ -235,16 +236,16 @@ def test_binary_out_tuple(self, xp):
235236 def test_biary_out_positional_none (self , xp ):
236237 dtype = xp .float64
237238 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
238- b = xp .ones ((2 , 3 ), dtype )
239+ b = xp .ones ((2 , 3 ), dtype = dtype )
239240 return xp .add (a , b , None )
240241
241242 @testing .numpy_cupy_allclose ()
242243 def test_divmod_out_tuple (self , xp ):
243244 dtype = xp .float64
244245 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
245246 b = testing .shaped_reverse_arange ((2 , 3 ), xp , dtype )
246- out0 = xp .zeros ((2 , 3 ), dtype )
247- out1 = xp .zeros ((2 , 3 ), dtype )
247+ out0 = xp .zeros ((2 , 3 ), dtype = dtype )
248+ out1 = xp .zeros ((2 , 3 ), dtype = dtype )
248249 ret = xp .divmod (a , b , out = (out0 , out1 ))
249250 assert ret [0 ] is out0
250251 assert ret [1 ] is out1
@@ -254,15 +255,15 @@ def test_divmod_out_tuple(self, xp):
254255 def test_divmod_out_positional_none (self , xp ):
255256 dtype = xp .float64
256257 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
257- b = xp .ones ((2 , 3 ), dtype )
258+ b = xp .ones ((2 , 3 ), dtype = dtype )
258259 return xp .divmod (a , b , None , None )
259260
260261 @testing .numpy_cupy_allclose ()
261262 def test_divmod_out_partial (self , xp ):
262263 dtype = xp .float64
263264 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
264265 b = testing .shaped_reverse_arange ((2 , 3 ), xp , dtype )
265- out0 = xp .zeros ((2 , 3 ), dtype )
266+ out0 = xp .zeros ((2 , 3 ), dtype = dtype )
266267 ret = xp .divmod (a , b , out0 ) # out1 is None
267268 assert ret [0 ] is out0
268269 return ret
@@ -272,7 +273,7 @@ def test_divmod_out_partial_tuple(self, xp):
272273 dtype = xp .float64
273274 a = testing .shaped_arange ((2 , 3 ), xp , dtype )
274275 b = testing .shaped_reverse_arange ((2 , 3 ), xp , dtype )
275- out1 = xp .zeros ((2 , 3 ), dtype )
276+ out1 = xp .zeros ((2 , 3 ), dtype = dtype )
276277 ret = xp .divmod (a , b , out = (None , out1 ))
277278 assert ret [1 ] is out1
278279 return ret
0 commit comments