@@ -563,9 +563,13 @@ def test_basic(self, dtype, n, norm):
563
563
564
564
result = dpnp .fft .hfft (ia , n = n , norm = norm )
565
565
expected = numpy .fft .hfft (a , n = n , norm = norm )
566
- # check_only_type_kind=True since NumPy always returns float64
567
- # but dpnp return float32 if input is float32
568
- assert_dtype_allclose (result , expected , check_only_type_kind = True )
566
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
567
+ # and being used with Intel NumPy >= 2.0.0
568
+ flag = True
569
+ # flag = True if numpy_version() < "2.0.0" else False
570
+ assert_dtype_allclose (
571
+ result , expected , factor = 24 , check_only_type_kind = flag
572
+ )
569
573
570
574
@pytest .mark .parametrize (
571
575
"dtype" , get_all_dtypes (no_none = True , no_complex = True )
@@ -579,7 +583,7 @@ def test_inverse(self, dtype, n, norm):
579
583
result = dpnp .fft .ihfft (ia , n = n , norm = norm )
580
584
expected = numpy .fft .ihfft (a , n = n , norm = norm )
581
585
flag = True if numpy_version () < "2.0.0" else False
582
- assert_dtype_allclose (result , expected , check_only_type_kind = True )
586
+ assert_dtype_allclose (result , expected , check_only_type_kind = flag )
583
587
584
588
def test_error (self ):
585
589
a = dpnp .ones (11 )
@@ -600,14 +604,13 @@ class TestIrfft:
600
604
@pytest .mark .parametrize ("n" , [None , 5 , 18 ])
601
605
@pytest .mark .parametrize ("norm" , [None , "backward" , "forward" , "ortho" ])
602
606
def test_basic (self , dtype , n , norm ):
603
- a = generate_random_numpy_array (11 )
607
+ a = generate_random_numpy_array (11 , dtype = dtype )
604
608
ia = dpnp .array (a )
605
609
606
610
result = dpnp .fft .irfft (ia , n = n , norm = norm )
607
611
expected = numpy .fft .irfft (a , n = n , norm = norm )
608
- # check_only_type_kind=True since NumPy always returns float64
609
- # but dpnp return float32 if input is float32
610
- assert_dtype_allclose (result , expected , check_only_type_kind = True )
612
+ flag = True if numpy_version () < "2.0.0" else False
613
+ assert_dtype_allclose (result , expected , check_only_type_kind = flag )
611
614
612
615
@pytest .mark .parametrize ("dtype" , get_complex_dtypes ())
613
616
@pytest .mark .parametrize ("n" , [None , 5 , 8 ])
@@ -771,8 +774,11 @@ def test_float16(self):
771
774
772
775
expected = numpy .fft .rfft (a )
773
776
result = dpnp .fft .rfft (ia )
774
- # check_only_type_kind=True since Intel NumPy returns complex128
775
- assert_dtype_allclose (result , expected , check_only_type_kind = True )
777
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
778
+ # and being used with Intel NumPy >= 2.0.0
779
+ flag = True
780
+ # flag = True if numpy_version() < "2.0.0" else False
781
+ assert_dtype_allclose (result , expected , check_only_type_kind = flag )
776
782
777
783
@testing .with_requires ("numpy>=2.0.0" )
778
784
@pytest .mark .parametrize ("xp" , [numpy , dpnp ])
@@ -954,7 +960,8 @@ def test_1d_array(self):
954
960
955
961
result = dpnp .fft .irfftn (ia )
956
962
expected = numpy .fft .irfftn (a )
957
- # TODO: change to the commented line when mkl_fft-gh-180 is merged
963
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
964
+ # and being used with Intel NumPy >= 2.0.0
958
965
flag = True
959
966
# flag = True if numpy_version() < "2.0.0" else False
960
967
assert_dtype_allclose (result , expected , check_only_type_kind = flag )
0 commit comments