Skip to content

Commit

Permalink
[tests][BugFix] transfer arrays to cpu in math test
Browse files Browse the repository at this point in the history
  • Loading branch information
joanrue authored and SepandKashani committed Mar 27, 2024
1 parent 54cefb9 commit cd32c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pyxu_tests/util/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd32c87

Please sign in to comment.