Skip to content

Commit d390b9e

Browse files
committed
Test shape and dtype in test_matrix_power
1 parent 4cccc26 commit d390b9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

array_api_tests/test_linalg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ def test_matrix_norm(x, kw):
301301
)
302302
def test_matrix_power(x, n):
303303
res = linalg.matrix_power(x, n)
304+
305+
assert res.shape == x.shape, "matrix_power() did not return the correct shape"
306+
assert res.dtype == x.dtype, "matrix_power() did not return the correct dtype"
307+
304308
if n == 0:
305309
true_val = lambda x: _array_module.eye(x.shape[0], dtype=x.dtype)
306310
else:

0 commit comments

Comments
 (0)