(self)
| 3269 | assert_raises(TypeError, np.dot, A, c) |
| 3270 | |
| 3271 | def test_dot_out_mem_overlap(self): |
| 3272 | np.random.seed(1) |
| 3273 | |
| 3274 | # Test BLAS and non-BLAS code paths, including all dtypes |
| 3275 | # that dot() supports |
| 3276 | dtypes = [np.dtype(code) for code in np.typecodes['All'] |
| 3277 | if code not in 'USVM'] |
| 3278 | for dtype in dtypes: |
| 3279 | a = np.random.rand(3, 3).astype(dtype) |
| 3280 | |
| 3281 | # Valid dot() output arrays must be aligned |
| 3282 | b = _aligned_zeros((3, 3), dtype=dtype) |
| 3283 | b[...] = np.random.rand(3, 3) |
| 3284 | |
| 3285 | y = np.dot(a, b) |
| 3286 | x = np.dot(a, b, out=b) |
| 3287 | assert_equal(x, y, err_msg=repr(dtype)) |
| 3288 | |
| 3289 | # Check invalid output array |
| 3290 | assert_raises(ValueError, np.dot, a, b, out=b[::2]) |
| 3291 | assert_raises(ValueError, np.dot, a, b, out=b.T) |
| 3292 | |
| 3293 | def test_dot_matmul_out(self): |
| 3294 | # gh-9641 |
nothing calls this directly
no test coverage detected