@@ -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,16 @@ 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
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
613
+ # and being used with Intel NumPy >= 2.0.0
614
+ flag = True
615
+ # flag = True if numpy_version() < "2.0.0" else False
616
+ assert_dtype_allclose (result , expected , check_only_type_kind = flag )
611
617
612
618
@pytest .mark .parametrize ("dtype" , get_complex_dtypes ())
613
619
@pytest .mark .parametrize ("n" , [None , 5 , 8 ])
@@ -771,8 +777,11 @@ def test_float16(self):
771
777
772
778
expected = numpy .fft .rfft (a )
773
779
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 )
780
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
781
+ # and being used with Intel NumPy >= 2.0.0
782
+ flag = True
783
+ # flag = True if numpy_version() < "2.0.0" else False
784
+ assert_dtype_allclose (result , expected , check_only_type_kind = flag )
776
785
777
786
@testing .with_requires ("numpy>=2.0.0" )
778
787
@pytest .mark .parametrize ("xp" , [numpy , dpnp ])
@@ -954,7 +963,8 @@ def test_1d_array(self):
954
963
955
964
result = dpnp .fft .irfftn (ia )
956
965
expected = numpy .fft .irfftn (a )
957
- # TODO: change to the commented line when mkl_fft-gh-180 is merged
966
+ # TODO: change to the commented line when mkl_fft-2.0.0 is released
967
+ # and being used with Intel NumPy >= 2.0.0
958
968
flag = True
959
969
# flag = True if numpy_version() < "2.0.0" else False
960
970
assert_dtype_allclose (result , expected , check_only_type_kind = flag )
0 commit comments