Hello,
I am encountering a very strange behaviour of einsum on my machine. I
tracked the problem down to the following test code:

from numpy import *

T = random.random((3,10,10))
W = random.random((3,10,7,275))

print all(einsum('ij...,j...->i...',T[0],W[0]) + 
einsum('ij...,j...->i...',T[1],W[1]) + einsum('ij...,j...->i...',T[2],W[2]) - 
einsum('pij,pjts->its',T,W)<  1e-10)
print sum(abs(einsum('ij...,j...->i...',T[0],W[0]) + 
einsum('ij...,j...->i...',T[1],W[1]) + einsum('ij...,j...->i...',T[2],W[2]) - 
einsum('pij,pjts->its',T,W)))

On my machine the equality is not fulfilled. However, this depends,
strange enough, on the dimensions of W: if the last dimension e.g. is
500 instead of 275, things work again and the equality is fulfilled.

Are you encountering similar problems or is this just my
machine/installation?

Since I am heavily relying on einsum but can't trust my code any more, I
am happily waiting for you answers.

Thanks a lot!
Wieland

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to