Added another einsum operation

This commit is contained in:
Alan Saul 2015-04-30 13:59:00 +01:00
parent 55b77064d4
commit 2dcfabf300
2 changed files with 18 additions and 0 deletions

View file

@ -50,3 +50,10 @@ class LinalgTests(np.testing.TestCase):
pure = np.einsum('ijk,jlk->il', A, B)
quick = GPy.util.linalg.ijk_jlk_to_il(A,B)
np.testing.assert_allclose(pure, quick)
def test_einsum_ijk_ljk_to_ilk(self):
A = np.random.randn(150, 20, 5)
B = np.random.randn(20, 30, 5)
pure = np.einsum('ijk,jlk->il', A, B)
quick = GPy.util.linalg.ijk_jlk_to_il(A,B)
np.testing.assert_allclose(pure, quick)