Skip to content

Commit 8fb5e01

Browse files
authored
Merge pull request #240 from asmeurer/test_eye-fix
Avoid using .size in test_eye
2 parents fec6f35 + 4fef89c commit 8fb5e01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array_api_tests/test_creation_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_eye(n_rows, n_cols, kw):
359359
[[1 if j - i == k else 0 for j in range(_n_cols)] for i in range(n_rows)],
360360
dtype=out.dtype # Note: dtype already checked above.
361361
)
362-
if expected.size == 0:
362+
if 0 in expected.shape:
363363
expected = xp.reshape(expected, (n_rows, _n_cols))
364364
ph.assert_array_elements("eye", out=out, expected=expected, kw=kw)
365365

0 commit comments

Comments
 (0)