Skip to content

Commit 7c31597

Browse files
committed
Rudimentary tests for ifft, fftn and ifftn
1 parent da8e374 commit 7c31597

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

array_api_tests/test_fft.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ def test_fft(x):
3636
out = xp.fft.fft(x)
3737
assert_fft_dtype("fft", in_dtype=x.dtype, out_dtype=out.dtype)
3838
ph.assert_shape("fft", out_shape=out.shape, expected=x.shape)
39+
40+
41+
@given(x=xps.arrays(dtype=xps.floating_dtypes(), shape=fft_shapes_strat))
42+
def test_ifft(x):
43+
out = xp.fft.ifft(x)
44+
assert_fft_dtype("ifft", in_dtype=x.dtype, out_dtype=out.dtype)
45+
ph.assert_shape("ifft", out_shape=out.shape, expected=x.shape)
46+
47+
48+
@given(x=xps.arrays(dtype=xps.floating_dtypes(), shape=fft_shapes_strat))
49+
def test_fftn(x):
50+
out = xp.fft.fftn(x)
51+
assert_fft_dtype("fftn", in_dtype=x.dtype, out_dtype=out.dtype)
52+
ph.assert_shape("fftn", out_shape=out.shape, expected=x.shape)
53+
54+
55+
@given(x=xps.arrays(dtype=xps.floating_dtypes(), shape=fft_shapes_strat))
56+
def test_ifftn(x):
57+
out = xp.fft.ifftn(x)
58+
assert_fft_dtype("ifftn", in_dtype=x.dtype, out_dtype=out.dtype)
59+
ph.assert_shape("ifftn", out_shape=out.shape, expected=x.shape)

0 commit comments

Comments
 (0)