Skip to content

Commit

Permalink
TST: sinc: add 3D test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascolley committed Nov 14, 2024
1 parent 68e0a6f commit 1fe453f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,9 @@ def test_simple(self):
def test_dtype(self, x):
with pytest.raises(ValueError, match="real floating data type"):
sinc(xp.asarray(x), xp=xp)

def test_3d(self):
x = xp.reshape(xp.arange(18, dtype=xp.float64), (3, 3, 2))
expected = xp.zeros((3, 3, 2))
expected[0, 0, 0] = 1.0
assert_allclose(sinc(x, xp=xp), expected, atol=1e-15)

0 comments on commit 1fe453f

Please sign in to comment.