@@ -2386,7 +2386,6 @@ def test_flatten(self):
2386
2386
assert_equal (x1 .flatten ('F' ), x1 .T .flatten ())
2387
2387
2388
2388
2389
- @pytest .mark .xfail (reason = "TODO np.dot" )
2390
2389
@pytest .mark .parametrize ('func' , (np .dot , np .matmul ))
2391
2390
def test_arr_mult (self , func ):
2392
2391
a = np .array ([[1 , 0 ], [0 , 1 ]])
@@ -2428,7 +2427,27 @@ def test_arr_mult(self, func):
2428
2427
assert_equal (func (ebf .T , ebf ), eaf )
2429
2428
assert_equal (func (ebf , ebf .T ), eaf )
2430
2429
assert_equal (func (ebf .T , ebf .T ), eaf )
2430
+ # syrk - different shape
2431
+ for et in [np .float32 , np .float64 , np .complex64 , np .complex128 ]:
2432
+ edf = d .astype (et )
2433
+ eddtf = ddt .astype (et )
2434
+ edtdf = dtd .astype (et )
2435
+ assert_equal (func (edf , edf .T ), eddtf )
2436
+ assert_equal (func (edf .T , edf ), edtdf )
2431
2437
2438
+ assert_equal (
2439
+ func (edf [:edf .shape [0 ] // 2 , :], edf [::2 , :].T ),
2440
+ func (edf [:edf .shape [0 ] // 2 , :].copy (), edf [::2 , :].T .copy ())
2441
+ )
2442
+ assert_equal (
2443
+ func (edf [::2 , :], edf [:edf .shape [0 ] // 2 , :].T ),
2444
+ func (edf [::2 , :].copy (), edf [:edf .shape [0 ] // 2 , :].T .copy ())
2445
+ )
2446
+
2447
+
2448
+ @pytest .mark .skip (reason = "dot/matmul with negative strides" )
2449
+ @pytest .mark .parametrize ('func' , (np .dot , np .matmul ))
2450
+ def test_arr_mult_2 (self , func ):
2432
2451
# syrk - different shape, stride, and view validations
2433
2452
for et in [np .float32 , np .float64 , np .complex64 , np .complex128 ]:
2434
2453
edf = d .astype (et )
@@ -2448,22 +2467,6 @@ def test_arr_mult(self, func):
2448
2467
func (edf , edf [:, ::- 1 ].T ),
2449
2468
func (edf , edf [:, ::- 1 ].T .copy ())
2450
2469
)
2451
- assert_equal (
2452
- func (edf [:edf .shape [0 ] // 2 , :], edf [::2 , :].T ),
2453
- func (edf [:edf .shape [0 ] // 2 , :].copy (), edf [::2 , :].T .copy ())
2454
- )
2455
- assert_equal (
2456
- func (edf [::2 , :], edf [:edf .shape [0 ] // 2 , :].T ),
2457
- func (edf [::2 , :].copy (), edf [:edf .shape [0 ] // 2 , :].T .copy ())
2458
- )
2459
-
2460
- # syrk - different shape
2461
- for et in [np .float32 , np .float64 , np .complex64 , np .complex128 ]:
2462
- edf = d .astype (et )
2463
- eddtf = ddt .astype (et )
2464
- edtdf = dtd .astype (et )
2465
- assert_equal (func (edf , edf .T ), eddtf )
2466
- assert_equal (func (edf .T , edf ), edtdf )
2467
2470
2468
2471
@pytest .mark .xfail (reason = "TODO np.dot" )
2469
2472
@pytest .mark .parametrize ('func' , (np .dot , np .matmul ))
@@ -2481,6 +2484,11 @@ def test_no_dgemv(self, func, dtype):
2481
2484
ret2 = func (b .T .copy (), a .T )
2482
2485
assert_equal (ret1 , ret2 )
2483
2486
2487
+
2488
+ @pytest .mark .skip (reason = "__array_interface__" )
2489
+ @pytest .mark .parametrize ('func' , (np .dot , np .matmul ))
2490
+ @pytest .mark .parametrize ('dtype' , 'ifdFD' )
2491
+ def test_no_dgemv_2 (self , func , dtype ):
2484
2492
# check for unaligned data
2485
2493
dt = np .dtype (dtype )
2486
2494
a = np .zeros (8 * dt .itemsize // 2 + 1 , dtype = 'int16' )[1 :].view (dtype )
@@ -2496,7 +2504,6 @@ def test_no_dgemv(self, func, dtype):
2496
2504
ret2 = func (b .T .copy (), a .T .copy ())
2497
2505
assert_equal (ret1 , ret2 )
2498
2506
2499
- @pytest .mark .xfail (reason = "TODO np.dot" )
2500
2507
def test_dot (self ):
2501
2508
a = np .array ([[1 , 0 ], [0 , 1 ]])
2502
2509
b = np .array ([[0 , 1 ], [1 , 0 ]])
@@ -2515,15 +2522,8 @@ def test_dot(self):
2515
2522
a .dot (b = b , out = c )
2516
2523
assert_equal (c , np .dot (a , b ))
2517
2524
2518
- @pytest .mark .xfail (reason = "TODO np.dot" )
2519
- def test_dot_type_mismatch (self ):
2520
- c = 1.
2521
- A = np .array ((1 ,1 ), dtype = 'i,i' )
2522
2525
2523
- assert_raises (TypeError , np .dot , c , A )
2524
- assert_raises (TypeError , np .dot , A , c )
2525
-
2526
- @pytest .mark .xfail (reason = "TODO np.dot" )
2526
+ @pytest .mark .xfail (reason = "_aligned_zeros" )
2527
2527
def test_dot_out_mem_overlap (self ):
2528
2528
np .random .seed (1 )
2529
2529
0 commit comments