From 56788adfced4f329142e4191bbc57af7a9316fd1 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Fri, 20 Mar 2026 22:07:37 +0100 Subject: [PATCH] MAINT: remove a _conj workaround for reals --- array_api_tests/test_linalg.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/array_api_tests/test_linalg.py b/array_api_tests/test_linalg.py index 9fbee39e..e73bc0a9 100644 --- a/array_api_tests/test_linalg.py +++ b/array_api_tests/test_linalg.py @@ -961,14 +961,6 @@ def true_trace(x_stack, offset=0): _test_stacks(linalg.trace, x, **kw, res=res, dims=0, true_val=true_trace) -def _conj(x): - # XXX: replace with xp.dtype when all array libraries implement it - if x.dtype in (xp.complex64, xp.complex128): - return xp.conj(x) - else: - return x - - def _test_vecdot(namespace, x1, x2, data): vecdot = namespace.vecdot broadcasted_shape = sh.broadcast_shapes(x1.shape, x2.shape) @@ -994,7 +986,7 @@ def _test_vecdot(namespace, x1, x2, data): out_shape=res.shape, expected=expected_shape) def true_val(x, y, axis=-1): - return xp.sum(xp.multiply(_conj(x), y), dtype=res.dtype) + return xp.sum(xp.multiply(xp.conj(x), y), dtype=res.dtype) _test_stacks(vecdot, x1, x2, res=res, dims=0, matrix_axes=(axis,), true_val=true_val)