Fixed linalg for general matricies

This commit is contained in:
Alan Saul 2015-04-30 14:22:46 +01:00
parent 2dcfabf300
commit 16e6d39317
2 changed files with 8 additions and 7 deletions

View file

@ -53,7 +53,8 @@ class LinalgTests(np.testing.TestCase):
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)
B = np.random.randn(150, 20, 5)
#B = A.copy()
pure = np.einsum('ijk,ljk->ilk', A, B)
quick = GPy.util.linalg.ijk_ljk_to_ilk(A,B)
np.testing.assert_allclose(pure, quick)