(self)
| 7440 | assert_equal(np.vdot(b, b), res) |
| 7441 | |
| 7442 | def test_vdot_uncontiguous(self): |
| 7443 | for size in [2, 1000]: |
| 7444 | # Different sizes match different branches in vdot. |
| 7445 | a = np.zeros((size, 2, 2)) |
| 7446 | b = np.zeros((size, 2, 2)) |
| 7447 | a[:, 0, 0] = np.arange(size) |
| 7448 | b[:, 0, 0] = np.arange(size) + 1 |
| 7449 | # Make a and b uncontiguous: |
| 7450 | a = a[..., 0] |
| 7451 | b = b[..., 0] |
| 7452 | |
| 7453 | assert_equal(np.vdot(a, b), |
| 7454 | np.vdot(a.flatten(), b.flatten())) |
| 7455 | assert_equal(np.vdot(a, b.copy()), |
| 7456 | np.vdot(a.flatten(), b.flatten())) |
| 7457 | assert_equal(np.vdot(a.copy(), b), |
| 7458 | np.vdot(a.flatten(), b.flatten())) |
| 7459 | assert_equal(np.vdot(a.copy('F'), b), |
| 7460 | np.vdot(a.flatten(), b.flatten())) |
| 7461 | assert_equal(np.vdot(a, b.copy('F')), |
| 7462 | np.vdot(a.flatten(), b.flatten())) |
| 7463 | |
| 7464 | |
| 7465 | class TestDot: |
nothing calls this directly
no test coverage detected