fixed trace_dot to be a litle faster...

This commit is contained in:
James Hensman 2013-03-12 12:20:46 +00:00
parent ba78e720f2
commit 0503d0e3f5
2 changed files with 2 additions and 3 deletions

View file

@ -18,8 +18,7 @@ def trace_dot(a,b):
"""
efficiently compute the trace of the matrix product of a and b
"""
assert a.shape==b.T.shape
return np.dot(a.flatten(),b.T.flatten())
return np.sum(a*b)
def mdot(*args):
"""Multiply all the arguments using matrix product rules.