Skip to content

Commit cd8b39a

Browse files
committed
chore: add test for _numpy_fft interface
1 parent bc56166 commit cd8b39a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mkl_fft/tests/test_fftnd.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ def test_matrix5(self):
114114
rtol=r_tol, atol=a_tol
115115
)
116116

117+
def test_matrix6(self):
118+
"""fftn with tuple, list and ndarray axes and s"""
119+
for ar in [self.md, self.mz, self.mf, self.mc]:
120+
d = ar.copy()
121+
for norm in ["forward", "backward", "ortho"]:
122+
for container in [tuple, list, np.array]:
123+
axes = container(range(d.ndim))
124+
s = container(d.shape)
125+
kwargs = dict(s=s, axes=axes, norm=norm)
126+
r_tol, a_tol = _get_rtol_atol(d)
127+
t = mkl_fft._numpy_fft.fftn(mkl_fft._numpy_fft.ifftn(d, **kwargs), **kwargs)
128+
assert_allclose(d, t, rtol=r_tol, atol=a_tol, err_msg = "failed test for dtype {}, max abs diff: {}".format(d.dtype, np.max(np.abs(d-t))))
117129

118130

119131

0 commit comments

Comments
 (0)