@@ -483,13 +483,11 @@ def _cumprod(self, xp, a, *args, **kwargs):
483483 return res
484484
485485 @testing .for_all_dtypes ()
486- # TODO: remove type_check once proper cumprod is implemented
487- @testing .numpy_cupy_allclose (type_check = (not is_win_platform ()))
486+ @testing .numpy_cupy_allclose ()
488487 def test_cumprod_1dim (self , xp , dtype ):
489488 a = testing .shaped_arange ((5 ,), xp , dtype )
490489 return self ._cumprod (xp , a )
491490
492- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
493491 @testing .for_all_dtypes ()
494492 @testing .numpy_cupy_allclose ()
495493 def test_cumprod_out (self , xp , dtype ):
@@ -498,7 +496,6 @@ def test_cumprod_out(self, xp, dtype):
498496 self ._cumprod (xp , a , out = out )
499497 return out
500498
501- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
502499 @testing .for_all_dtypes ()
503500 @testing .numpy_cupy_allclose ()
504501 def test_cumprod_out_noncontiguous (self , xp , dtype ):
@@ -507,24 +504,18 @@ def test_cumprod_out_noncontiguous(self, xp, dtype):
507504 self ._cumprod (xp , a , out = out )
508505 return out
509506
510- # TODO: remove skip once proper cumprod is implemented
511- @pytest .mark .skipif (
512- is_win_platform (), reason = "numpy has another default integral dtype"
513- )
514507 @testing .for_all_dtypes ()
515508 @testing .numpy_cupy_allclose (rtol = 1e-6 )
516509 def test_cumprod_2dim_without_axis (self , xp , dtype ):
517510 a = testing .shaped_arange ((4 , 5 ), xp , dtype )
518511 return self ._cumprod (xp , a )
519512
520- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
521513 @testing .for_all_dtypes ()
522514 @testing .numpy_cupy_allclose ()
523515 def test_cumprod_2dim_with_axis (self , xp , dtype ):
524516 a = testing .shaped_arange ((4 , 5 ), xp , dtype )
525517 return self ._cumprod (xp , a , axis = 1 )
526518
527- @pytest .mark .skip ("ndarray.cumprod() is not implemented yet" )
528519 @testing .for_all_dtypes ()
529520 @testing .numpy_cupy_allclose ()
530521 def test_ndarray_cumprod_2dim_with_axis (self , xp , dtype ):
@@ -535,53 +526,44 @@ def test_ndarray_cumprod_2dim_with_axis(self, xp, dtype):
535526 @testing .slow
536527 def test_cumprod_huge_array (self ):
537528 size = 2 ** 32
538- # Free huge memory for slow test
539- cupy .get_default_memory_pool ().free_all_blocks ()
540- a = cupy .ones (size , "b" )
529+ a = cupy .ones (size , dtype = "b" )
541530 result = cupy .cumprod (a , dtype = "b" )
542531 del a
543532 assert (result == 1 ).all ()
544533 # Free huge memory for slow test
545534 del result
546- cupy .get_default_memory_pool ().free_all_blocks ()
547535
548- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
549536 @testing .for_all_dtypes ()
550537 def test_invalid_axis_lower1 (self , dtype ):
551538 for xp in (numpy , cupy ):
552539 a = testing .shaped_arange ((4 , 5 ), xp , dtype )
553540 with pytest .raises (numpy .AxisError ):
554541 xp .cumprod (a , axis = - a .ndim - 1 )
555542
556- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
557543 @testing .for_all_dtypes ()
558544 def test_invalid_axis_lower2 (self , dtype ):
559545 for xp in (numpy , cupy ):
560546 a = testing .shaped_arange ((4 , 5 ), xp , dtype )
561547 with pytest .raises (numpy .AxisError ):
562548 xp .cumprod (a , axis = - a .ndim - 1 )
563549
564- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
565550 @testing .for_all_dtypes ()
566551 def test_invalid_axis_upper1 (self , dtype ):
567552 for xp in (numpy , cupy ):
568553 a = testing .shaped_arange ((4 , 5 ), xp , dtype )
569554 with pytest .raises (numpy .AxisError ):
570555 return xp .cumprod (a , axis = a .ndim )
571556
572- @pytest .mark .usefixtures ("allow_fall_back_on_numpy" )
573557 @testing .for_all_dtypes ()
574558 def test_invalid_axis_upper2 (self , dtype ):
575559 a = testing .shaped_arange ((4 , 5 ), cupy , dtype )
576560 with pytest .raises (numpy .AxisError ):
577561 return cupy .cumprod (a , axis = a .ndim )
578562
579- @pytest .mark .skip ("no exception is raised by numpy" )
580563 def test_cumprod_arraylike (self ):
581564 with pytest .raises (TypeError ):
582565 return cupy .cumprod ((1 , 2 , 3 ))
583566
584- @pytest .mark .skip ("no exception is raised by numpy" )
585567 @testing .for_float_dtypes ()
586568 def test_cumprod_numpy_array (self , dtype ):
587569 a_numpy = numpy .arange (1 , 6 , dtype = dtype )
0 commit comments