-
Notifications
You must be signed in to change notification settings - Fork 20
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
Replace inner1d bei einsum #163
base: master
Are you sure you want to change the base?
Conversation
I like the PEP8 changes, except for the spaces around
"definitely" is quite a strong word. "improvement", too. What if it's much slower? |
I guess some instances can be replaced with the |
The test for Python 3.5 fails as the installed
I also very much dislike Python 3.5 and would simply remove support for it. |
The other test fails as |
I created a pull request where I run the tests directly on Github (and skip Python 3.5): #166 |
I rebased the master, now the tests are passing. |
I rebased and made code work for recent 0.6.1 / 0.6.2. We will need a handling once inner1d() is discontinued, so it might be a good idea to keep this einsum() handling up to date. I would vote using this some time. |
We use
from numpy.core.umath_tests import inner1d as _inner1d
which is suboptimal, since its deprecated and requires non-standard library import.
See also #77
We could use numpy's
einsum
do to this job instead, thus I've changed (hopefully) all occurrences ofinner1d
toeinsum
.Besides that in the files, some PEP8 modifications were done, these suggestions came from PyCharm.
Maybe numpy's
tensordot
is even more performant/suitable. I don't know currently how/if these functions support parallel computation, whichinner1d
seemed to do and was chosen for. I will check this.In the meantime, using
einsum
in this PR is definitely an improvement for the code.