From 178d106b3f04556831a544d1f58343a46efb7b80 Mon Sep 17 00:00:00 2001 From: Matt Haberland Date: Mon, 14 Sep 2026 21:50:44 -0700 Subject: [PATCH] TST: test_linalg::test_outer: avoid `asarray` on nested sequence of arrays --- array_api_tests/test_linalg.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/array_api_tests/test_linalg.py b/array_api_tests/test_linalg.py index 87a7652f..7831e135 100644 --- a/array_api_tests/test_linalg.py +++ b/array_api_tests/test_linalg.py @@ -561,10 +561,10 @@ def test_outer(x1, x2): if 0 in shape: true_res = xp.empty(shape, dtype=res.dtype) else: - true_res = xp.asarray([[x1[i]*x2[j] - for j in range(x2.shape[0])] - for i in range(x1.shape[0])], - dtype=res.dtype) + true_res = xp.asarray(xp.stack([xp.stack([x1[i]*x2[j] + for j in range(x2.shape[0])]) + for i in range(x1.shape[0])]), + dtype=res.dtype) assert_exactly_equal(res, true_res)