Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 4 commits into from
Jun 2, 2018
Merged

BUG: Fixes einsum broadcasting bug when optimize=True #11218

merged 4 commits into from
Jun 2, 2018

Conversation

rsokl
Copy link
Contributor

@rsokl rsokl commented Jun 1, 2018

Closes #10930.

@charris charris added this to the 1.14.4 release milestone Jun 1, 2018
p = np.ones((1, 5))
q = np.ones((5, 5))

# a blas-compatible contraction broadcasting case which was failing
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it.

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
Copy link
Member

@charris charris Jun 1, 2018

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?

Copy link
Member

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.

@charris
Copy link
Member

charris commented Jun 1, 2018

LGTM, I'll wait on @dgasmith .

Copy link
Contributor

@dgasmith dgasmith left a 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.

q = np.ones((5, 5))
# a blas-compatible contraction broadcasting case which was failing
# for optimize=True (ticket #10930)
x = np.array([0., 0.])
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@rsokl
Copy link
Contributor Author

rsokl commented Jun 1, 2018

@dgasmith this should be good to go now (updated the test as you requested)

@charris charris merged commit 8c55ee6 into numpy:master Jun 2, 2018
@charris
Copy link
Member

charris commented Jun 2, 2018

Thanks @rsokl . For next time, might take a look at the howto for commit messages at doc/source/dev/gitwash/development_workflow.rst.

@rsokl
Copy link
Contributor Author

rsokl commented Jun 2, 2018

Ah thanks for pointing me to that. I wasn't aware of it. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants