Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5e5c51a

Browse filesBrowse files
committed
TST: matmul does not conjugate; wrong?
1 parent 8bb9374 commit 5e5c51a
Copy full SHA for 5e5c51a

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎numpy/_core/tests/test_ufunc.py

Copy file name to clipboardExpand all lines: numpy/_core/tests/test_ufunc.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,10 @@ def test_vecdot_matvec_vecmat_complex(self, ufunc, shape1, shape2, conj):
868868
expected1 = np.array(((arr1.conj() if conj else arr1) * arr2).sum(),
869869
ndmin=min(len(shape1), len(shape2)))
870870
assert_array_equal(actual1, expected1)
871+
# This would fail for conj=True, since matmul omits the conjugate.
872+
if not conj:
873+
assert_array_equal(arr1.reshape(shape1) @ arr2.reshape(shape2),
874+
expected1)
871875

872876
actual2 = ufunc(arr2.reshape(shape1), arr1.reshape(shape2))
873877
expected2 = np.array(((arr2.conj() if conj else arr2) * arr1).sum(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.