From e2ae30b09f400f797130dcc464a742d4481f1caf Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 19 Nov 2024 15:48:23 -0700 Subject: [PATCH] Conjugate the first argument in vecdot This is currently untested by the test suite (data-apis/array-api-tests#312) Fixes #97. --- array_api_strict/_linear_algebra_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array_api_strict/_linear_algebra_functions.py b/array_api_strict/_linear_algebra_functions.py index 5ffdaa6..6af2a15 100644 --- a/array_api_strict/_linear_algebra_functions.py +++ b/array_api_strict/_linear_algebra_functions.py @@ -86,5 +86,5 @@ def vecdot(x1: Array, x2: Array, /, *, axis: int = -1) -> Array: x1_ = np.moveaxis(x1_, axis, -1) x2_ = np.moveaxis(x2_, axis, -1) - res = x1_[..., None, :] @ x2_[..., None] + res = np.conj(x1_[..., None, :]) @ x2_[..., None] return Array._new(res[..., 0, 0], device=x1.device)