Skip to content

Commit 2da7fff

Browse files
committed
ENH: test vectot conjugation
A small no-hypothsis test to make sure vecdot conjugates its first argument
1 parent dad7731 commit 2da7fff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: array_api_tests/test_linalg.py

+10
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,16 @@ def test_vecdot(x1, x2, data):
964964
_test_vecdot(_array_module, x1, x2, data)
965965

966966

967+
@pytest.mark.xp_extension('linalg')
968+
def test_vecdot_conj():
969+
# no-hypothesis test to check that the 1st argument is in fact conjugated
970+
x1 = xp.asarray([1j, 2j, 3j])
971+
x2 = xp.asarray([1, 2j, 3])
972+
973+
import cmath
974+
assert cmath.isclose(complex(xp.linalg.vecdot(x1, x2)), 4 - 10j)
975+
976+
967977
# Insanely large orders might not work. There isn't a limit specified in the
968978
# spec, so we just limit to reasonable values here.
969979
max_ord = 100

0 commit comments

Comments
 (0)