MCPcopy
hub / github.com/numpy/numpy / test_dot

Method test_dot

numpy/_core/tests/test_multiarray.py:3838–3854  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3836 assert_equal(ret1, ret2)
3837
3838 def test_dot(self):
3839 a = np.array([[1, 0], [0, 1]])
3840 b = np.array([[0, 1], [1, 0]])
3841 c = np.array([[9, 1], [1, -9]])
3842 # function versus methods
3843 assert_equal(np.dot(a, b), a.dot(b))
3844 assert_equal(np.dot(np.dot(a, b), c), a.dot(b).dot(c))
3845
3846 # test passing in an output array
3847 c = np.zeros_like(a)
3848 a.dot(b, c)
3849 assert_equal(c, np.dot(a, b))
3850
3851 # test keyword args
3852 c = np.zeros_like(a)
3853 a.dot(b=b, out=c)
3854 assert_equal(c, np.dot(a, b))
3855
3856 @pytest.mark.parametrize("dtype", [np.half, np.double, np.longdouble])
3857 @pytest.mark.skipif(IS_WASM, reason="no wasm fp exception support")

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
dotMethod · 0.80
zeros_likeMethod · 0.80

Tested by

no test coverage detected