MCPcopy Create free account
hub / github.com/numpy/numpy / test_three_arguments_and_out

Method test_three_arguments_and_out

numpy/linalg/tests/test_linalg.py:2020–2031  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2018 assert_equal(multi_dot([A1d, B, C, D1d]).shape, ())
2019
2020 def test_three_arguments_and_out(self):
2021 # multi_dot with three arguments uses a fast hand coded algorithm to
2022 # determine the optimal order. Therefore test it separately.
2023 A = np.random.random((6, 2))
2024 B = np.random.random((2, 6))
2025 C = np.random.random((6, 2))
2026
2027 out = np.zeros((6, 2))
2028 ret = multi_dot([A, B, C], out=out)
2029 assert out is ret
2030 assert_almost_equal(out, A.dot(B).dot(C))
2031 assert_almost_equal(out, np.dot(A, np.dot(B, C)))
2032
2033 def test_two_arguments_and_out(self):
2034 # separate code path with two arguments

Callers

nothing calls this directly

Calls 4

multi_dotFunction · 0.90
assert_almost_equalFunction · 0.90
randomMethod · 0.80
dotMethod · 0.80

Tested by

no test coverage detected