@@ -119,6 +119,7 @@ def _test_namedtuple(res, fields, func_name):
119
119
assert hasattr (res , field ), f"{ func_name } () result namedtuple doesn't have the '{ field } ' field"
120
120
assert res [i ] is getattr (res , field ), f"{ func_name } () result namedtuple '{ field } ' field is not in position { i } "
121
121
122
+ @pytest .mark .unvectorized
122
123
@pytest .mark .xp_extension ('linalg' )
123
124
@given (
124
125
x = positive_definite_matrices (),
@@ -175,6 +176,7 @@ def cross_args(draw, dtype_objects=dh.real_dtypes):
175
176
)
176
177
return draw (arrays1 ), draw (arrays2 ), kw
177
178
179
+ @pytest .mark .unvectorized
178
180
@pytest .mark .xp_extension ('linalg' )
179
181
@given (
180
182
cross_args ()
@@ -209,6 +211,7 @@ def exact_cross(a, b):
209
211
# vectors.
210
212
_test_stacks (linalg .cross , x1 , x2 , dims = 1 , matrix_axes = (axis ,), res = res , true_val = exact_cross )
211
213
214
+ @pytest .mark .unvectorized
212
215
@pytest .mark .xp_extension ('linalg' )
213
216
@given (
214
217
x = arrays (dtype = all_floating_dtypes (), shape = square_matrix_shapes ),
@@ -224,6 +227,7 @@ def test_det(x):
224
227
225
228
# TODO: Test that res actually corresponds to the determinant of x
226
229
230
+ @pytest .mark .unvectorized
227
231
@pytest .mark .xp_extension ('linalg' )
228
232
@given (
229
233
x = arrays (dtype = xps .scalar_dtypes (), shape = matrix_shapes ()),
@@ -261,6 +265,7 @@ def true_diag(x_stack, offset=0):
261
265
262
266
_test_stacks (linalg .diagonal , x , ** kw , res = res , dims = 1 , true_val = true_diag )
263
267
268
+ @pytest .mark .unvectorized
264
269
@pytest .mark .xp_extension ('linalg' )
265
270
@given (x = symmetric_matrices (finite = True ))
266
271
def test_eigh (x ):
@@ -299,6 +304,7 @@ def test_eigh(x):
299
304
# TODO: Test that res actually corresponds to the eigenvalues and
300
305
# eigenvectors of x
301
306
307
+ @pytest .mark .unvectorized
302
308
@pytest .mark .xp_extension ('linalg' )
303
309
@given (x = symmetric_matrices (finite = True ))
304
310
def test_eigvalsh (x ):
@@ -319,6 +325,7 @@ def test_eigvalsh(x):
319
325
320
326
# TODO: Test that res actually corresponds to the eigenvalues of x
321
327
328
+ @pytest .mark .unvectorized
322
329
@pytest .mark .xp_extension ('linalg' )
323
330
@given (x = invertible_matrices ())
324
331
def test_inv (x ):
@@ -372,19 +379,22 @@ def _test_matmul(namespace, x1, x2):
372
379
expected = stack_shape + (x1 .shape [- 2 ], x2 .shape [- 1 ]))
373
380
_test_stacks (matmul , x1 , x2 , res = res )
374
381
382
+ @pytest .mark .unvectorized
375
383
@pytest .mark .xp_extension ('linalg' )
376
384
@given (
377
385
* two_mutual_arrays (dh .real_dtypes )
378
386
)
379
387
def test_linalg_matmul (x1 , x2 ):
380
388
return _test_matmul (linalg , x1 , x2 )
381
389
390
+ @pytest .mark .unvectorized
382
391
@given (
383
392
* two_mutual_arrays (dh .real_dtypes )
384
393
)
385
394
def test_matmul (x1 , x2 ):
386
395
return _test_matmul (_array_module , x1 , x2 )
387
396
397
+ @pytest .mark .unvectorized
388
398
@pytest .mark .xp_extension ('linalg' )
389
399
@given (
390
400
x = finite_matrices (),
@@ -410,6 +420,7 @@ def test_matrix_norm(x, kw):
410
420
res = res )
411
421
412
422
matrix_power_n = shared (integers (- 100 , 100 ), key = 'matrix_power n' )
423
+ @pytest .mark .unvectorized
413
424
@pytest .mark .xp_extension ('linalg' )
414
425
@given (
415
426
# Generate any square matrix if n >= 0 but only invertible matrices if n < 0
@@ -433,6 +444,7 @@ def test_matrix_power(x, n):
433
444
func = lambda x : linalg .matrix_power (x , n )
434
445
_test_stacks (func , x , res = res , true_val = true_val )
435
446
447
+ @pytest .mark .unvectorized
436
448
@pytest .mark .xp_extension ('linalg' )
437
449
@given (
438
450
x = finite_matrices (shape = rtol_shared_matrix_shapes ),
@@ -457,13 +469,15 @@ def _test_matrix_transpose(namespace, x):
457
469
458
470
_test_stacks (matrix_transpose , x , res = res , true_val = true_val )
459
471
472
+ @pytest .mark .unvectorized
460
473
@pytest .mark .xp_extension ('linalg' )
461
474
@given (
462
475
x = arrays (dtype = xps .scalar_dtypes (), shape = matrix_shapes ()),
463
476
)
464
477
def test_linalg_matrix_transpose (x ):
465
478
return _test_matrix_transpose (linalg , x )
466
479
480
+ @pytest .mark .unvectorized
467
481
@given (
468
482
x = arrays (dtype = xps .scalar_dtypes (), shape = matrix_shapes ()),
469
483
)
@@ -503,6 +517,7 @@ def test_outer(x1, x2):
503
517
def test_pinv (x , kw ):
504
518
linalg .pinv (x , ** kw )
505
519
520
+ @pytest .mark .unvectorized
506
521
@pytest .mark .xp_extension ('linalg' )
507
522
@given (
508
523
x = arrays (dtype = all_floating_dtypes (), shape = matrix_shapes ()),
@@ -545,6 +560,7 @@ def test_qr(x, kw):
545
560
# Check that R is upper-triangular.
546
561
assert_exactly_equal (R , _array_module .triu (R ))
547
562
563
+ @pytest .mark .unvectorized
548
564
@pytest .mark .xp_extension ('linalg' )
549
565
@given (
550
566
x = arrays (dtype = all_floating_dtypes (), shape = square_matrix_shapes ),
@@ -617,6 +633,7 @@ def _x2_shapes(draw):
617
633
x2 = arrays (shape = x2_shapes , dtype = mutual_dtypes .map (lambda pair : pair [1 ]))
618
634
return x1 , x2
619
635
636
+ @pytest .mark .unvectorized
620
637
@pytest .mark .xp_extension ('linalg' )
621
638
@given (* solve_args ())
622
639
def test_solve (x1 , x2 ):
@@ -635,6 +652,7 @@ def test_solve(x1, x2):
635
652
ph .assert_result_shape ("solve" , in_shapes = [x1 .shape , x2 .shape ],
636
653
out_shape = res .shape , expected = expected_shape )
637
654
655
+ @pytest .mark .unvectorized
638
656
@pytest .mark .xp_extension ('linalg' )
639
657
@given (
640
658
x = finite_matrices (),
@@ -685,6 +703,7 @@ def test_svd(x, kw):
685
703
_test_stacks (lambda x : linalg .svd (x , ** kw ).S , x , dims = 1 , res = S )
686
704
_test_stacks (lambda x : linalg .svd (x , ** kw ).Vh , x , res = Vh )
687
705
706
+ @pytest .mark .unvectorized
688
707
@pytest .mark .xp_extension ('linalg' )
689
708
@given (
690
709
x = finite_matrices (),
@@ -818,6 +837,7 @@ def _test_tensordot(namespace, x1, x2, kw):
818
837
expected = result_shape )
819
838
_test_tensordot_stacks (x1 , x2 , kw , res )
820
839
840
+ @pytest .mark .unvectorized
821
841
@pytest .mark .xp_extension ('linalg' )
822
842
@given (
823
843
* two_mutual_arrays (dh .numeric_dtypes , two_shapes = tensordot_shapes ()),
@@ -826,13 +846,15 @@ def _test_tensordot(namespace, x1, x2, kw):
826
846
def test_linalg_tensordot (x1 , x2 , kw ):
827
847
_test_tensordot (linalg , x1 , x2 , kw )
828
848
849
+ @pytest .mark .unvectorized
829
850
@given (
830
851
* two_mutual_arrays (dh .numeric_dtypes , two_shapes = tensordot_shapes ()),
831
852
tensordot_kw ,
832
853
)
833
854
def test_tensordot (x1 , x2 , kw ):
834
855
_test_tensordot (_array_module , x1 , x2 , kw )
835
856
857
+ @pytest .mark .unvectorized
836
858
@pytest .mark .xp_extension ('linalg' )
837
859
@given (
838
860
x = arrays (dtype = xps .numeric_dtypes (), shape = matrix_shapes ()),
@@ -910,6 +932,7 @@ def true_val(x, y, axis=-1):
910
932
matrix_axes = (axis ,), true_val = true_val )
911
933
912
934
935
+ @pytest .mark .unvectorized
913
936
@pytest .mark .xp_extension ('linalg' )
914
937
@given (
915
938
* two_mutual_arrays (dh .numeric_dtypes , mutually_broadcastable_shapes (2 , min_dims = 1 )),
@@ -918,6 +941,7 @@ def true_val(x, y, axis=-1):
918
941
def test_linalg_vecdot (x1 , x2 , data ):
919
942
_test_vecdot (linalg , x1 , x2 , data )
920
943
944
+ @pytest .mark .unvectorized
921
945
@given (
922
946
* two_mutual_arrays (dh .numeric_dtypes , mutually_broadcastable_shapes (2 , min_dims = 1 )),
923
947
data (),
@@ -929,6 +953,7 @@ def test_vecdot(x1, x2, data):
929
953
# spec, so we just limit to reasonable values here.
930
954
max_ord = 100
931
955
956
+ @pytest .mark .unvectorized
932
957
@pytest .mark .xp_extension ('linalg' )
933
958
@given (
934
959
x = arrays (dtype = all_floating_dtypes (), shape = shapes (min_side = 1 )),
0 commit comments