We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eba1f35 commit 5368f8eCopy full SHA for 5368f8e
array_api_tests/test_linalg.py
@@ -307,14 +307,22 @@ def test_matmul(x1, x2):
307
assert res.shape == stack_shape + (x1.shape[-2], x2.shape[-1])
308
_test_stacks(_array_module.matmul, x1, x2, res=res)
309
310
+matrix_norm_shapes = shared(matrix_shapes())
311
+
312
@pytest.mark.xp_extension('linalg')
313
@given(
- x=xps.arrays(dtype=xps.floating_dtypes(), shape=shapes()),
- kw=kwargs(axis=todo, keepdims=todo, ord=todo)
314
+ x=finite_matrices,
315
+ kw=kwargs(keepdims=booleans(),
316
+ ord=sampled_from([1, 2, float('inf'), -float('inf'), 'fro', 'nuc']))
317
)
318
def test_matrix_norm(x, kw):
- # res = linalg.matrix_norm(x, **kw)
- pass
319
+ res = linalg.matrix_norm(x, **kw)
320
321
+ keepdims = kw.get('keepdims', False)
322
+ ord = kw.get('ord', 'fro')
323
324
+ _test_stacks(linalg.matrix_norm, x, **kw, dims=2 if keepdims else 0,
325
+ res=res)
326
327
matrix_power_n = shared(integers(-1000, 1000), key='matrix_power n')
328
0 commit comments