From cd32c8773f2ecab6a5a828235a50e78220a7b73d Mon Sep 17 00:00:00 2001 From: Joan Rue Queralt Date: Fri, 22 Mar 2024 15:31:46 +0100 Subject: [PATCH] [tests][BugFix] transfer arrays to cpu in math test --- src/pyxu_tests/util/test_complex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyxu_tests/util/test_complex.py b/src/pyxu_tests/util/test_complex.py index 8ca40e5f2..a18418639 100644 --- a/src/pyxu_tests/util/test_complex.py +++ b/src/pyxu_tests/util/test_complex.py @@ -304,8 +304,8 @@ def test_math(self, dim_shape, complex_in, real_out, seed): x_r = pxu.view_as_real(x) dim_rank = len(dim_shape) - ip_R = np.tensordot(real_out, x_r, axes=dim_rank + 1) # real-valued tensor contraction - ip_C = np.tensordot(complex_in, x, axes=dim_rank) # complex-valued tensor contraction + ip_R = np.tensordot(pxu.to_NUMPY(real_out), x_r, axes=dim_rank + 1) # real-valued tensor contraction + ip_C = np.tensordot(pxu.to_NUMPY(complex_in), x, axes=dim_rank) # complex-valued tensor contraction ip_C_r = pxu.view_as_real(ip_C) assert np.allclose(ip_C_r, ip_R)