From ad63d69724a8408ff1acacee0fc37fe2e3343cb6 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Mon, 16 Oct 2023 12:49:58 -0400 Subject: [PATCH] Remove unused 'out' argument --- pytorch_finufft/functional.py | 11 ----------- tests/test_1d/test_backward_1d.py | 2 -- tests/test_2d/test_backward_2d.py | 2 -- tests/test_2d/test_forward_2d.py | 1 - tests/test_3d/test_backward_3d.py | 2 -- 5 files changed, 18 deletions(-) diff --git a/pytorch_finufft/functional.py b/pytorch_finufft/functional.py index f14287c..479959f 100644 --- a/pytorch_finufft/functional.py +++ b/pytorch_finufft/functional.py @@ -78,18 +78,12 @@ def forward( # type: ignore[override] points: torch.Tensor, values: torch.Tensor, output_shape: Union[int, Tuple[int, int], Tuple[int, int, int]], - out: Optional[torch.Tensor] = None, finufftkwargs: Optional[Dict[str, Union[int, float]]] = None, ) -> torch.Tensor: """ Evaluates the Type 1 NUFFT on the inputs. """ - if out is not None: - # All this requires is a check on the out array to make sure it is the - # correct shape. - raise NotImplementedError("In-place results are not yet implemented") - checks.check_devices(values, points) checks.check_dtypes(values, points, "Values") checks.check_sizes_t1(values, points) @@ -197,7 +191,6 @@ def forward( # type: ignore[override] ctx: Any, points: torch.Tensor, targets: torch.Tensor, - out: Optional[torch.Tensor] = None, finufftkwargs: Optional[Dict[str, Union[int, float]]] = None, ) -> torch.Tensor: """ @@ -230,10 +223,6 @@ def forward( # type: ignore[override] ------ """ - - if out is not None: - raise NotImplementedError("In-place results are not yet implemented") - checks.check_devices(targets, points) checks.check_dtypes(targets, points, "Targets") checks.check_sizes_t2(targets, points) diff --git a/tests/test_1d/test_backward_1d.py b/tests/test_1d/test_backward_1d.py index b4918bd..9753ad3 100644 --- a/tests/test_1d/test_backward_1d.py +++ b/tests/test_1d/test_backward_1d.py @@ -47,7 +47,6 @@ def func(points, values): points, values, (N + modifier,), - None, dict(modeord=int(not fftshift), isign=isign), ) @@ -114,7 +113,6 @@ def func(points, targets): return pytorch_finufft.functional.finufft_type2.apply( points, targets, - None, dict(modeord=int(not fftshift), isign=isign), ) diff --git a/tests/test_2d/test_backward_2d.py b/tests/test_2d/test_backward_2d.py index f76a918..687ce67 100644 --- a/tests/test_2d/test_backward_2d.py +++ b/tests/test_2d/test_backward_2d.py @@ -58,7 +58,6 @@ def func(points, values): points, values, (N, N + modifier), - None, dict(modeord=int(not fftshift), isign=isign), ) @@ -125,7 +124,6 @@ def func(points, targets): return pytorch_finufft.functional.finufft_type2.apply( points, targets, - None, dict(modeord=int(not fftshift), isign=isign), ) diff --git a/tests/test_2d/test_forward_2d.py b/tests/test_2d/test_forward_2d.py index 52a32c4..c8f7640 100644 --- a/tests/test_2d/test_forward_2d.py +++ b/tests/test_2d/test_forward_2d.py @@ -82,7 +82,6 @@ def test_t2_forward_CPU(N: int, fftshift: bool) -> None: finufft_out = pytorch_finufft.functional.finufft_type2.apply( points, targets, - None, {"modeord": int(not fftshift)}, ) diff --git a/tests/test_3d/test_backward_3d.py b/tests/test_3d/test_backward_3d.py index 4e21d80..3eb324d 100644 --- a/tests/test_3d/test_backward_3d.py +++ b/tests/test_3d/test_backward_3d.py @@ -50,7 +50,6 @@ def func(points, values): points, values, (N, N + modifier, N + 2 * modifier), - None, dict(modeord=int(not fftshift), isign=isign), ) @@ -122,7 +121,6 @@ def func(points, targets): return pytorch_finufft.functional.finufft_type2.apply( points, targets, - None, dict(modeord=int(not fftshift), isign=isign), )