diff --git a/dpnp/tests/test_fft.py b/dpnp/tests/test_fft.py index 3a8d3c0c466..8da3489595a 100644 --- a/dpnp/tests/test_fft.py +++ b/dpnp/tests/test_fft.py @@ -551,9 +551,8 @@ def test_basic(self, func, dtype, axes): class TestHfft: - # TODO: include boolean dtype when mkl_fft-gh-180 is merged @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True) + "dtype", get_all_dtypes(no_none=True) ) @pytest.mark.parametrize("n", [None, 5, 18]) @pytest.mark.parametrize("norm", [None, "backward", "forward", "ortho"]) @@ -789,11 +788,10 @@ def test_validate_out(self): class TestRfft2: - # TODO: add other axes when mkl_fft gh-119 is addressed @pytest.mark.parametrize( "dtype", get_all_dtypes(no_none=True, no_complex=True) ) - @pytest.mark.parametrize("axes", [(0, 1)]) # (1, 2),(0, 2),(2, 1),(2, 0) + @pytest.mark.parametrize("axes", [(0, 1), (1, 2), (0, 2), (2, 1), (2, 0)]) @pytest.mark.parametrize("norm", [None, "backward", "forward", "ortho"]) @pytest.mark.parametrize("order", ["C", "F"]) def test_basic(self, dtype, axes, norm, order): @@ -848,12 +846,11 @@ def test_error(self, xp): class TestRfftn: - # TODO: add additional axes when mkl_fft gh-119 is addressed @pytest.mark.parametrize( "dtype", get_all_dtypes(no_none=True, no_complex=True) ) @pytest.mark.parametrize( - "axes", [(0, 1, 2), (-2, -4, -1, -3)] # (-1, -4, -2) + "axes", [(0, 1, 2), (-2, -4, -1, -3), (-1, -4, -2)] ) @pytest.mark.parametrize("norm", [None, "backward", "forward", "ortho"]) @pytest.mark.parametrize("order", ["C", "F"]) @@ -954,7 +951,5 @@ def test_1d_array(self): result = dpnp.fft.irfftn(ia) expected = numpy.fft.irfftn(a) - # TODO: change to the commented line when mkl_fft-gh-180 is merged - flag = True - # flag = True if numpy_version() < "2.0.0" else False + flag = True if numpy_version() < "2.0.0" else False assert_dtype_allclose(result, expected, check_only_type_kind=flag) diff --git a/dpnp/tests/third_party/cupy/fft_tests/test_fft.py b/dpnp/tests/third_party/cupy/fft_tests/test_fft.py index 5c0368278f9..534b474363f 100644 --- a/dpnp/tests/third_party/cupy/fft_tests/test_fft.py +++ b/dpnp/tests/third_party/cupy/fft_tests/test_fft.py @@ -378,21 +378,21 @@ def test_fft_allocate(self): {"shape": (3, 4), "s": (1, 5), "axes": (-2, -1)}, {"shape": (3, 4), "s": None, "axes": (-2, -1)}, {"shape": (3, 4), "s": None, "axes": (-1, -2)}, - # {"shape": (3, 4), "s": None, "axes": (0,)}, # mkl_fft gh-109 + {"shape": (3, 4), "s": None, "axes": (0,)}, {"shape": (3, 4), "s": None, "axes": None}, - # {"shape": (3, 4), "s": None, "axes": ()}, # mkl_fft gh-108 + {"shape": (3, 4), "s": None, "axes": ()}, {"shape": (2, 3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-2, -1)}, {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, - # {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, # mkl_fft gh-109 + {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, {"shape": (2, 3, 4), "s": None, "axes": None}, - # {"shape": (2, 3, 4), "s": None, "axes": ()}, # mkl_fft gh-108 - # {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, # mkl_fft gh-109 + {"shape": (2, 3, 4), "s": None, "axes": ()}, + {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, {"shape": (2, 3, 4, 5), "s": None, "axes": None}, - # {"shape": (0, 5), "s": None, "axes": None}, # mkl_fft gh-110 - # {"shape": (2, 0, 5), "s": None, "axes": None}, # mkl_fft gh-110 - # {"shape": (0, 0, 5), "s": None, "axes": None}, # mkl_fft gh-110 + {"shape": (0, 5), "s": None, "axes": None}, + {"shape": (2, 0, 5), "s": None, "axes": None}, + {"shape": (0, 0, 5), "s": None, "axes": None}, {"shape": (3, 4), "s": (0, 5), "axes": (-2, -1)}, {"shape": (3, 4), "s": (1, 0), "axes": (-2, -1)}, ], @@ -468,23 +468,23 @@ def test_ifft2(self, xp, dtype, order, enable_nd): {"shape": (3, 4), "s": None, "axes": (-2, -1)}, {"shape": (3, 4), "s": None, "axes": (-1, -2)}, {"shape": (3, 4), "s": None, "axes": [-1, -2]}, - # {"shape": (3, 4), "s": None, "axes": (0,)}, # mkl_fft gh-109 - # {"shape": (3, 4), "s": None, "axes": ()}, # mkl_fft gh-108 + {"shape": (3, 4), "s": None, "axes": (0,)}, + {"shape": (3, 4), "s": None, "axes": ()}, {"shape": (3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-3, -2, -1)}, {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, - # {"shape": (2, 3, 4), "s": None, "axes": (-1, -3)}, # mkl_fft gh-109 - # {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, # mkl_fft gh-109 + {"shape": (2, 3, 4), "s": None, "axes": (-1, -3)}, + {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, {"shape": (2, 3, 4), "s": None, "axes": None}, - # {"shape": (2, 3, 4), "s": None, "axes": ()}, # mkl_fft gh-108 - # {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, # mkl_fft gh-109 + {"shape": (2, 3, 4), "s": None, "axes": ()}, + {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, {"shape": (2, 3, 4), "s": (4, 3, 2), "axes": (2, 0, 1)}, {"shape": (2, 3, 4, 5), "s": None, "axes": None}, - # {"shape": (0, 5), "s": None, "axes": None}, # mkl_fft gh-110 - # {"shape": (2, 0, 5), "s": None, "axes": None}, # mkl_fft gh-110 - # {"shape": (0, 0, 5), "s": None, "axes": None}, # mkl_fft gh-110 + {"shape": (0, 5), "s": None, "axes": None}, + {"shape": (2, 0, 5), "s": None, "axes": None}, + {"shape": (0, 0, 5), "s": None, "axes": None}, ], testing.product({"norm": [None, "backward", "ortho", "forward"]}), ) @@ -912,8 +912,7 @@ def test_rfft(self, xp, dtype): atol=2e-6, accept_error=ValueError, contiguous_check=False, - # TODO: replace with has_support_aspect64() when mkl_fft-gh-180 is merged - type_check=False, + type_check=has_support_aspect64(), ) def test_irfft(self, xp, dtype): a = testing.shaped_random(self.shape, xp, dtype) @@ -1002,14 +1001,14 @@ def test_rfft_error_on_wrong_plan(self, dtype): {"shape": (3, 4), "s": None, "axes": (-1, -2)}, {"shape": (3, 4), "s": None, "axes": (0,)}, {"shape": (3, 4), "s": None, "axes": None}, - # {"shape": (2, 3, 4), "s": None, "axes": None}, # mkl_fft gh-116 - # {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-3, -2, -1)}, # mkl_fft gh-115 - # {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, # mkl_fft gh-116 - # {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, # mkl_fft gh-116 + {"shape": (2, 3, 4), "s": None, "axes": None}, + {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-3, -2, -1)}, + {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, + {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, {"shape": (2, 3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, - # {"shape": (2, 3, 4, 5), "s": None, "axes": None}, # mkl_fft gh-109 and gh-116 + {"shape": (2, 3, 4, 5), "s": None, "axes": None}, ], testing.product( {"norm": [None, "backward", "ortho", "forward", ""]} @@ -1044,8 +1043,7 @@ def test_rfft2(self, xp, dtype, order, enable_nd): atol=1e-7, accept_error=ValueError, contiguous_check=False, - # TODO: replace with has_support_aspect64() when mkl_fft-gh-180 is merged - type_check=False, + type_check=has_support_aspect64(), ) def test_irfft2(self, xp, dtype, order, enable_nd): # assert config.enable_nd_planning == enable_nd @@ -1090,13 +1088,13 @@ def test_irfft2(self, dtype): {"shape": (3, 4), "s": None, "axes": (0,)}, {"shape": (3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": None, "axes": None}, - # {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-3, -2, -1)}, # mkl_fft gh-115 - # {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, # mkl_fft gh-116 - # {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, # mkl_fft gh-116 + {"shape": (2, 3, 4), "s": (1, 4, 10), "axes": (-3, -2, -1)}, + {"shape": (2, 3, 4), "s": None, "axes": (-3, -2, -1)}, + {"shape": (2, 3, 4), "s": None, "axes": (-1, -2, -3)}, {"shape": (2, 3, 4), "s": None, "axes": (0, 1)}, {"shape": (2, 3, 4), "s": None, "axes": None}, {"shape": (2, 3, 4), "s": (2, 3), "axes": (0, 1, 2)}, - # {"shape": (2, 3, 4, 5), "s": None, "axes": None}, # mkl_fft gh-109 and gh-116 + {"shape": (2, 3, 4, 5), "s": None, "axes": None}, ], testing.product( {"norm": [None, "backward", "ortho", "forward", ""]} @@ -1131,8 +1129,7 @@ def test_rfftn(self, xp, dtype, order, enable_nd): atol=1e-7, accept_error=ValueError, contiguous_check=False, - # TODO: replace with has_support_aspect64() when mkl_fft-gh-180 is merged - type_check=False, + type_check=has_support_aspect64(), ) def test_irfftn(self, xp, dtype, order, enable_nd): # assert config.enable_nd_planning == enable_nd @@ -1326,8 +1323,7 @@ class TestHfft: atol=2e-6, accept_error=ValueError, contiguous_check=False, - # TODO: replace with has_support_aspect64() when mkl_fft-gh-180 is merged - type_check=False, + type_check=has_support_aspect64(), ) def test_hfft(self, xp, dtype): a = testing.shaped_random(self.shape, xp, dtype)