(self)
| 6470 | assert_equal(np.vdot(b, b), res) |
| 6471 | |
| 6472 | def test_vdot_uncontiguous(self): |
| 6473 | for size in [2, 1000]: |
| 6474 | # Different sizes match different branches in vdot. |
| 6475 | a = np.zeros((size, 2, 2)) |
| 6476 | b = np.zeros((size, 2, 2)) |
| 6477 | a[:, 0, 0] = np.arange(size) |
| 6478 | b[:, 0, 0] = np.arange(size) + 1 |
| 6479 | # Make a and b uncontiguous: |
| 6480 | a = a[..., 0] |
| 6481 | b = b[..., 0] |
| 6482 | |
| 6483 | assert_equal(np.vdot(a, b), |
| 6484 | np.vdot(a.flatten(), b.flatten())) |
| 6485 | assert_equal(np.vdot(a, b.copy()), |
| 6486 | np.vdot(a.flatten(), b.flatten())) |
| 6487 | assert_equal(np.vdot(a.copy(), b), |
| 6488 | np.vdot(a.flatten(), b.flatten())) |
| 6489 | assert_equal(np.vdot(a.copy('F'), b), |
| 6490 | np.vdot(a.flatten(), b.flatten())) |
| 6491 | assert_equal(np.vdot(a, b.copy('F')), |
| 6492 | np.vdot(a.flatten(), b.flatten())) |
| 6493 | |
| 6494 | |
| 6495 | class TestDot: |
nothing calls this directly
no test coverage detected