-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Einsum double contraction in particular order causes ValueError #5147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting, It look like the error should be somewhere in this function, in case you want to try your hand at it... |
Hi same problem here (version 1.8.2). This fails for me x = np.random.normal(0, 1, (5, 5, 5, 5))
y1 = np.einsum('aabb->ab', x)
for i in xrange(5):
for j in xrange(5):
assert y1[i,j] == x[i,i,j,j]
y2 = np.zeros((5, 5))
np.einsum('aabb->ab', x, out=y2)
assert (y1 == y2).all() This does not reach the final assertion. Instead, I get the following error on the penultimate line:
|
Could it be that the error is rather on line 2240 instead of 2143? In the latter, there is explicitly a test that |
Yes, it does look like all you have to do is add to the condition in line 2237 something like |
fixed #5147 collapsingbug in einsum
fixed #5147 collapsingbug in einsum
Could there be a regression of this bug?
returns Summing
|
There is a test for this bug. |
@charris |
@mfdgroot That would be good. |
If I try to do
I get a
ValueError
:However, these alternatives work:
And these agree with the naive version up to the last decimal place
The text was updated successfully, but these errors were encountered: