From 1017e75154663cf64a1fdf965b84d3b961d114e2 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:04:56 +0000 Subject: [PATCH 1/7] feat: add FFT3D function to tensorflow.raw_ops --- .../frontends/tensorflow/raw_ops.py | 8 ++++ .../test_tensorflow/test_raw_ops.py | 39 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/ivy/functional/frontends/tensorflow/raw_ops.py b/ivy/functional/frontends/tensorflow/raw_ops.py index 6eb795c355b33..2b8e507fe1078 100644 --- a/ivy/functional/frontends/tensorflow/raw_ops.py +++ b/ivy/functional/frontends/tensorflow/raw_ops.py @@ -569,6 +569,14 @@ def FFT2D(*, input, name="FFT2D"): return ivy.astype(ivy.fft2(input, dim=(-2, -1)), input.dtype) +@to_ivy_arrays_and_back +def FFT3D(*, input, name="FFT3D"): + fft_result = ivy.fft(input, -1) + fft_result = ivy.fft(fft_result, -2) + fft_result = ivy.fft(fft_result, -3) + return ivy.astype(fft_result, input.dtype) + + @to_ivy_arrays_and_back def Fill(*, dims, value, name="Full"): return ivy.full(dims, value) diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py index 6bbbf9eb8b009..d2222f6487b73 100644 --- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py +++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_raw_ops.py @@ -1885,6 +1885,45 @@ def test_tensorflow_FFT2D( ) +# FFT3D +@handle_frontend_test( + fn_tree="tensorflow.raw_ops.FFT3D", + dtype_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("complex"), + min_value=-1e5, + max_value=1e5, + min_num_dims=3, + max_num_dims=5, + min_dim_size=2, + max_dim_size=5, + large_abs_safety_factor=2.5, + small_abs_safety_factor=2.5, + safety_factor_scale="log", + ), +) +def test_tensorflow_FFT3D( + *, + dtype_and_x, + frontend, + test_flags, + fn_tree, + backend_fw, + on_device, +): + dtype, x = dtype_and_x + helpers.test_frontend_function( + input_dtypes=dtype, + backend_to_test=backend_fw, + frontend=frontend, + test_flags=test_flags, + fn_tree=fn_tree, + on_device=on_device, + input=x[0], + rtol=1e-02, + atol=1e-02, + ) + + # fill @handle_frontend_test( fn_tree="tensorflow.raw_ops.Fill", From b4f99b81bc30bc2f810d79ed7347700963709e20 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Sat, 7 Oct 2023 08:57:44 +0000 Subject: [PATCH 2/7] add FFT3D function to tensorflow.raw_ops --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index f82c7bc8627cc..471fec53d5d69 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 +Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 From 462cc35a07e4b9bd035e8f61b60612095a0d5980 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Sat, 7 Oct 2023 10:30:35 +0000 Subject: [PATCH 3/7] updates --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index 471fec53d5d69..f82c7bc8627cc 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 +Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 From 690a9a0e21354f31b08ed1e71d15a106584a34d7 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Mon, 9 Oct 2023 05:43:14 +0000 Subject: [PATCH 4/7] update submodule --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index f82c7bc8627cc..471fec53d5d69 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 +Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 From 9a8126bddf42da182c0a14a10bdebb4ea22baf01 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:25:11 +0000 Subject: [PATCH 5/7] Revert "update submodule" This reverts commit 690a9a0e21354f31b08ed1e71d15a106584a34d7. --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index 471fec53d5d69..f82c7bc8627cc 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 +Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 From 278454aab589dd6c873d0941ea1af53d815adc21 Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:25:47 +0000 Subject: [PATCH 6/7] Revert "updates" This reverts commit 462cc35a07e4b9bd035e8f61b60612095a0d5980. --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index f82c7bc8627cc..471fec53d5d69 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 +Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 From 2eabb36701a8372568c530689902660eac229a5e Mon Sep 17 00:00:00 2001 From: Ayomide <120118911+Ayo-folashade@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:14:09 +0000 Subject: [PATCH 7/7] Revert submodule to previous state --- ivy_tests/array_api_testing/test_array_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivy_tests/array_api_testing/test_array_api b/ivy_tests/array_api_testing/test_array_api index 471fec53d5d69..f82c7bc8627cc 160000 --- a/ivy_tests/array_api_testing/test_array_api +++ b/ivy_tests/array_api_testing/test_array_api @@ -1 +1 @@ -Subproject commit 471fec53d5d69f0ad241d1c2bb6f13bfc430c892 +Subproject commit f82c7bc8627cc2c3a44fa3e425f53a253a609aa8