summaryrefslogtreecommitdiff
path: root/numpy/linalg
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-10-17 11:51:23 -0500
committerGitHub <noreply@github.com>2018-10-17 11:51:23 -0500
commitc3102330590090927d8de7495da6643f0ab7ec99 (patch)
tree3a297682f779a4ab7ab5c60e35b921d7bf0065cb /numpy/linalg
parent20cd7a59b4621fd21319064839a33a85a683c88b (diff)
parentc1ee3d86a23aced31e8f3b02ad93dd6509c28e59 (diff)
downloadnumpy-c3102330590090927d8de7495da6643f0ab7ec99.tar.gz
Merge pull request #12185 from tylerjereddy/multi_dot_n2_test
TST: test multi_dot with 2 arrays
Diffstat (limited to 'numpy/linalg')
-rw-r--r--numpy/linalg/tests/test_linalg.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
index 320d123e7..0e94c2633 100644
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -1835,6 +1835,14 @@ class TestMultiDot(object):
assert_almost_equal(multi_dot([A, B, C]), A.dot(B).dot(C))
assert_almost_equal(multi_dot([A, B, C]), np.dot(A, np.dot(B, C)))
+ def test_basic_function_with_two_arguments(self):
+ # separate code path with two arguments
+ A = np.random.random((6, 2))
+ B = np.random.random((2, 6))
+
+ assert_almost_equal(multi_dot([A, B]), A.dot(B))
+ assert_almost_equal(multi_dot([A, B]), np.dot(A, B))
+
def test_basic_function_with_dynamic_programing_optimization(self):
# multi_dot with four or more arguments uses the dynamic programing
# optimization and therefore deserve a separate