From 5a23a7e167c1202e8cfc0f2ad232ebc0cb679e69 Mon Sep 17 00:00:00 2001 From: anilipour Date: Wed, 10 Jun 2026 14:55:53 +0100 Subject: [PATCH] fix: move tensors to CPU before numpy conversion in downsample test Tests would fail on GPU since np.asarray() cannot handle CUDA tensors directly. Co-Authored-By: Claude Sonnet 4.6 --- tests/test_2D_FFT_Torch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_2D_FFT_Torch.py b/tests/test_2D_FFT_Torch.py index 7c04220..808a39f 100644 --- a/tests/test_2D_FFT_Torch.py +++ b/tests/test_2D_FFT_Torch.py @@ -62,9 +62,9 @@ def test_DataClass_downsample(): data, dg_out, inplace=False, target_fourier_status=False ) diff = np.asarray( - data_downsampled.array - data.array[..., :: 2**dg_out, :: 2**dg_out] + (data_downsampled.array - data.array[..., :: 2**dg_out, :: 2**dg_out]).cpu() ) - assert np.all(np.abs(diff) < threshold * np.abs(np.asarray(data_downsampled.array))) + assert np.all(np.abs(diff) < threshold * np.abs(np.asarray(data_downsampled.array.cpu()))) if __name__ == "__main__":