@@ -265,26 +265,26 @@ def test_matmul(x1, x2):
265
265
or len (x1 .shape ) >= 2 and len (x2 .shape ) >= 2 and x1 .shape [- 1 ] != x2 .shape [- 2 ]):
266
266
# The spec doesn't specify what kind of exception is used here. Most
267
267
# libraries will use a custom exception class.
268
- raises (Exception , lambda : linalg .matmul (x1 , x2 ),
268
+ raises (Exception , lambda : _array_module .matmul (x1 , x2 ),
269
269
"matmul did not raise an exception for invalid shapes" )
270
270
return
271
271
else :
272
- res = linalg .matmul (x1 , x2 )
272
+ res = _array_module .matmul (x1 , x2 )
273
273
274
274
assert res .dtype == promote_dtypes (x1 , x2 ), "matmul() did not return the correct dtype"
275
275
276
276
if len (x1 .shape ) == len (x2 .shape ) == 1 :
277
277
assert res .shape == ()
278
278
elif len (x1 .shape ) == 1 :
279
279
assert res .shape == x2 .shape [:- 2 ] + x2 .shape [- 1 :]
280
- _test_stacks (linalg .matmul , x1 , x2 , res = res , dims = 1 )
280
+ _test_stacks (_array_module .matmul , x1 , x2 , res = res , dims = 1 )
281
281
elif len (x2 .shape ) == 1 :
282
282
assert res .shape == x1 .shape [:- 1 ]
283
- _test_stacks (linalg .matmul , x1 , x2 , res = res , dims = 1 )
283
+ _test_stacks (_array_module .matmul , x1 , x2 , res = res , dims = 1 )
284
284
else :
285
285
stack_shape = broadcast_shapes (x1 .shape [:- 2 ], x2 .shape [:- 2 ])
286
286
assert res .shape == stack_shape + (x1 .shape [- 2 ], x2 .shape [- 1 ])
287
- _test_stacks (linalg .matmul , x1 , x2 , res = res )
287
+ _test_stacks (_array_module .matmul , x1 , x2 , res = res )
288
288
289
289
@given (
290
290
x = xps .arrays (dtype = xps .floating_dtypes (), shape = shapes ),
@@ -328,7 +328,7 @@ def test_matrix_rank(x, kw):
328
328
x = xps .arrays (dtype = dtypes , shape = matrix_shapes ()),
329
329
)
330
330
def test_matrix_transpose (x ):
331
- res = linalg .matrix_transpose (x )
331
+ res = _array_module .matrix_transpose (x )
332
332
true_val = lambda a : _array_module .asarray ([[a [i , j ] for i in
333
333
range (a .shape [0 ])] for j in
334
334
range (a .shape [1 ])],
@@ -339,7 +339,7 @@ def test_matrix_transpose(x):
339
339
assert res .shape == shape , "matrix_transpose() did not return the correct shape"
340
340
assert res .dtype == x .dtype , "matrix_transpose() did not return the correct dtype"
341
341
342
- _test_stacks (linalg .matrix_transpose , x , res = res , true_val = true_val )
342
+ _test_stacks (_array_module .matrix_transpose , x , res = res , true_val = true_val )
343
343
344
344
@given (
345
345
* two_mutual_arrays (dtype_objects = numeric_dtype_objects ,
@@ -497,7 +497,7 @@ def test_svdvals(x):
497
497
kw = kwargs (axes = todo )
498
498
)
499
499
def test_tensordot (x1 , x2 , kw ):
500
- # res = linalg .tensordot(x1, x2, **kw)
500
+ # res = _array_module .tensordot(x1, x2, **kw)
501
501
pass
502
502
503
503
@given (
@@ -514,7 +514,7 @@ def test_trace(x, kw):
514
514
kw = kwargs (axis = todo )
515
515
)
516
516
def test_vecdot (x1 , x2 , kw ):
517
- # res = linalg .vecdot(x1, x2, **kw)
517
+ # res = _array_module .vecdot(x1, x2, **kw)
518
518
pass
519
519
520
520
@given (
0 commit comments