-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Fixes einsum broadcasting bug when optimize=True #11218
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
Conversation
numpy/core/tests/test_einsum.py
Outdated
p = np.ones((1, 5)) | ||
q = np.ones((5, 5)) | ||
|
||
# a blas-compatible contraction broadcasting case which was failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace on these two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it.
numpy/core/tests/test_einsum.py
Outdated
assert_array_equal(np.einsum("i, i", x, y, optimize=True), 0.) | ||
|
||
# all-ones array was bypassing bug (ticket #10930) | ||
p = np.ones((1, 5)) / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why you wanted floats here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, I see you added a note.
LGTM, I'll wait on @dgasmith . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR.
numpy/core/tests/test_einsum.py
Outdated
q = np.ones((5, 5)) | ||
# a blas-compatible contraction broadcasting case which was failing | ||
# for optimize=True (ticket #10930) | ||
x = np.array([0., 0.]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use array of say 5s just incase we hit some sort of weird bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll have to wait until I'm home from work.
@dgasmith this should be good to go now (updated the test as you requested) |
Thanks @rsokl . For next time, might take a look at the howto for commit messages at |
Ah thanks for pointing me to that. I wasn't aware of it. Sorry about that. |
Closes #10930.