Repository: ivy-llc/ivy

Issue:
vorbis_window



Discussion:

Resolving patch:
diff --git a/ivy/functional/frontends/tensorflow/signal.py b/ivy/functional/frontends/tensorflow/signal.py
--- a/ivy/functional/frontends/tensorflow/signal.py
+++ b/ivy/functional/frontends/tensorflow/signal.py
@@ -14,6 +14,21 @@ def kaiser_window(window_length, beta=12.0, dtype=ivy.float32, name=None):
 kaiser_window.supported_dtypes = ("float32", "float64", "float16", "bfloat16")
 
 
+# dct
+@to_ivy_arrays_and_back
+def dct(input, type=2, n=None, axis=-1, norm=None, name=None):
+    return ivy.dct(input, type=type, n=n, axis=axis, norm=norm)
+
+
+# vorbis_window
+@to_ivy_arrays_and_back
+def vorbis_window(window_length, dtype=ivy.float32, name=None):
+    return ivy.vorbis_window(window_length, dtype=dtype, out=None)
+
+
+vorbis_window.supported_dtypes = ("float32", "float64", "float16", "bfloat16")
+
+
 # idct
 @to_ivy_arrays_and_back
 def idct(input, type=2, n=None, axis=-1, norm=None, name=None):


Test patch:
diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py
--- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py
+++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_signal.py
@@ -95,3 +95,84 @@ def test_tensorflow_idct(
         norm=norm,
         atol=1e-01,
     )
+
+
+# dct
+@handle_frontend_test(
+    fn_tree="tensorflow.signal.dct",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=["float32", "float64"],
+        max_value=65280,
+        min_value=-65280,
+        min_num_dims=1,
+        min_dim_size=2,
+        shared_dtype=True,
+    ),
+    n=helpers.ints(min_value=1, max_value=3),
+    norm=st.sampled_from([None, "ortho"]),
+    type=helpers.ints(min_value=1, max_value=4),
+    # dtype_x_and_args=valid_idct(),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_dct(
+    *,
+    dtype_and_x,
+    n,
+    norm,
+    type,
+    frontend,
+    test_flags,
+    fn_tree,
+    backend_fw,
+    on_device,
+):
+    (
+        input_dtype,
+        x,
+    ) = dtype_and_x
+    if norm == "ortho" and type == 1:
+        norm = None
+    axis = -1
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        input=x[0],
+        type=type,
+        n=n,
+        axis=axis,
+        norm=norm,
+        # atol=1e-01,
+    )
+
+
+# vorbis_window
+@handle_frontend_test(
+    fn_tree="tensorflow.signal.vorbis_window",
+    dtype_and_x=helpers.dtype_and_values(
+        available_dtypes=helpers.get_dtypes("valid"),
+        max_num_dims=0,
+        min_value=1,
+        max_value=10,
+    ),
+    # dtype=helpers.get_dtypes("float", full=False),
+    test_with_out=st.just(False),
+)
+def test_tensorflow_vorbis_window(
+    *, dtype_and_x, test_flags, backend_fw, fn_tree, on_device, frontend  # ,dtype
+):
+    input_dtype, x = dtype_and_x
+    helpers.test_frontend_function(
+        input_dtypes=input_dtype,
+        backend_to_test=backend_fw,
+        frontend=frontend,
+        test_flags=test_flags,
+        fn_tree=fn_tree,
+        on_device=on_device,
+        atol=1e-02,
+        window_length=int(x[0]),
+        # dtype=dtype[0],
+    )