From 4f58a586ed690844e543dc7404c4d07fc6518421 Mon Sep 17 00:00:00 2001 From: Michael Eickenberg Date: Thu, 5 Oct 2023 14:32:48 -0400 Subject: [PATCH] FIX add remaining test case, 1d type 2 --- tests/test_1d/test_forward_1d.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_1d/test_forward_1d.py b/tests/test_1d/test_forward_1d.py index 9050c52..404abf8 100644 --- a/tests/test_1d/test_forward_1d.py +++ b/tests/test_1d/test_forward_1d.py @@ -105,6 +105,14 @@ def test_1d_t2_forward_CPU(targets: torch.Tensor): 0, abs=1e-05 ) + abs_errors = torch.abs(finufft_out - against_torch) + l_inf_error = abs_errors.max() + l_2_error = torch.sqrt(torch.sum(abs_errors**2)) + l_1_error = torch.sum(abs_errors) + + assert l_inf_error < 3.5e-3 * N ** .6 + assert l_2_error < 7.5e-4 * N ** 1.1 + assert l_1_error < 5e-4 * N ** 1.6 # @pytest.mark.parametrize("values", cases) # def test_1d_t3_forward_CPU(values: torch.Tensor) -> None: