|
26 | 26 | invertible_matrices, two_mutual_arrays, |
27 | 27 | mutually_promotable_dtypes, one_d_shapes, |
28 | 28 | two_mutually_broadcastable_shapes, |
29 | | - SQRT_MAX_ARRAY_SIZE, finite_matrices) |
| 29 | + SQRT_MAX_ARRAY_SIZE, finite_matrices, |
| 30 | + rtol_shared_matrix_shapes, rtols) |
30 | 31 | from . import dtype_helpers as dh |
31 | 32 | from . import pytest_helpers as ph |
32 | 33 |
|
@@ -311,7 +312,7 @@ def test_matmul(x1, x2): |
311 | 312 |
|
312 | 313 | @pytest.mark.xp_extension('linalg') |
313 | 314 | @given( |
314 | | - x=finite_matrices, |
| 315 | + x=finite_matrices(), |
315 | 316 | kw=kwargs(keepdims=booleans(), |
316 | 317 | ord=sampled_from([-float('inf'), -2, -2, 1, 2, float('inf'), 'fro', 'nuc'])) |
317 | 318 | ) |
@@ -357,12 +358,11 @@ def test_matrix_power(x, n): |
357 | 358 |
|
358 | 359 | @pytest.mark.xp_extension('linalg') |
359 | 360 | @given( |
360 | | - x=xps.arrays(dtype=xps.floating_dtypes(), shape=shapes()), |
361 | | - kw=kwargs(rtol=todo) |
| 361 | + x=finite_matrices(shape=rtol_shared_matrix_shapes), |
| 362 | + kw=kwargs(rtol=rtols) |
362 | 363 | ) |
363 | 364 | def test_matrix_rank(x, kw): |
364 | | - # res = linalg.matrix_rank(x, **kw) |
365 | | - pass |
| 365 | + res = linalg.matrix_rank(x, **kw) |
366 | 366 |
|
367 | 367 | @given( |
368 | 368 | x=xps.arrays(dtype=dtypes, shape=matrix_shapes()), |
@@ -407,12 +407,11 @@ def test_outer(x1, x2): |
407 | 407 |
|
408 | 408 | @pytest.mark.xp_extension('linalg') |
409 | 409 | @given( |
410 | | - x=xps.arrays(dtype=xps.floating_dtypes(), shape=shapes()), |
411 | | - kw=kwargs(rtol=todo) |
| 410 | + x=finite_matrices(shape=rtol_shared_matrix_shapes), |
| 411 | + kw=kwargs(rtol=rtols) |
412 | 412 | ) |
413 | 413 | def test_pinv(x, kw): |
414 | | - # res = linalg.pinv(x, **kw) |
415 | | - pass |
| 414 | + res = linalg.pinv(x, **kw) |
416 | 415 |
|
417 | 416 | @pytest.mark.xp_extension('linalg') |
418 | 417 | @given( |
@@ -525,7 +524,7 @@ def test_solve(x1, x2): |
525 | 524 |
|
526 | 525 | @pytest.mark.xp_extension('linalg') |
527 | 526 | @given( |
528 | | - x=finite_matrices, |
| 527 | + x=finite_matrices(), |
529 | 528 | kw=kwargs(full_matrices=booleans()) |
530 | 529 | ) |
531 | 530 | def test_svd(x, kw): |
@@ -561,7 +560,7 @@ def test_svd(x, kw): |
561 | 560 |
|
562 | 561 | @pytest.mark.xp_extension('linalg') |
563 | 562 | @given( |
564 | | - x=finite_matrices, |
| 563 | + x=finite_matrices(), |
565 | 564 | ) |
566 | 565 | def test_svdvals(x): |
567 | 566 | res = linalg.svdvals(x) |
|
0 commit comments