diff --git a/ivy/functional/frontends/torch/spectral_ops.py b/ivy/functional/frontends/torch/spectral_ops.py index 10065bde0f4cb..8727252e94d46 100644 --- a/ivy/functional/frontends/torch/spectral_ops.py +++ b/ivy/functional/frontends/torch/spectral_ops.py @@ -44,3 +44,18 @@ def blackman_window( requires_grad=False ): return ivy.blackman_window(window_length, periodic=periodic, dtype=dtype) + + +@to_ivy_arrays_and_back +@with_supported_dtypes({"2.51.0 and below": ("float32", "float64")}, "torch") +def kaiser_window( + window_length, + periodic=True, + beta=12.0, + *, + dtype=None, + layout=None, + device=None, + requires_grad=False +): + return ivy.kaiser_window(window_length, periodic=periodic, beta=beta, dtype=dtype) diff --git a/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py b/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py index 0724fde02443d..6e6376537f430 100644 --- a/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py +++ b/ivy_tests/test_ivy/test_frontends/test_torch/test_spectral_ops.py @@ -64,3 +64,38 @@ def test_torch_blackman_window( rtol=1e-02, atol=1e-02, ) + + +@handle_frontend_test( + window_length=helpers.ints(min_value=1, max_value=100), + dtype=helpers.get_dtypes("float", full=False), + fn_tree="torch.kaiser_window", + periodic=st.booleans(), + beta=helpers.floats(min_value=1, max_value=20), +) +def test_torch_kaiser_window( + *, + window_length, + dtype, + periodic, + beta, + on_device, + fn_tree, + frontend, + backend_fw, + test_flags, +): + helpers.test_frontend_function( + input_dtypes=[], + on_device=on_device, + frontend=frontend, + backend_to_test=backend_fw, + test_flags=test_flags, + fn_tree=fn_tree, + window_length=window_length, + periodic=periodic, + beta=beta, + dtype=dtype[0], + rtol=1e-02, + atol=1e-02, + )