-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Einsum changes #37
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
Einsum changes #37
Conversation
This makes the following equivalent: einsum('ii', a) einsum(a, [0,0]) einsum('ii->i', a) einsum(a, [0,0], [0]) einsum('...i,...i->...', a, b) einsum(a, [Ellipsis,0], b, [Ellipsis,0], [Ellipsis])
This conflicts with Pauli's fixes in multiarraymodule.c, so it would be helpful if you rebased it to current master, maybe after fixing the two bugs Pauli reported. It might even make sense to try to move the einsum stuff out of multiarraymodule so it is more independent. Apart from that, einsum is new and mostly stand alone, so I don't worry as much about errors. There is always the possibility of memory leaks, though. Might be worth checking with valgrind at some point. |
I was just doing the rebase. :) Using some static analysis tools might help improve einsum/NumPy's robustness too. |
Do you have any static analysis tools in mind? |
Two possibilities: |
Also converted the used inner loops to SSE2, to bring einsum fairly close to numpy.dot's performance for matrix-vector and matrix-matrix multiplication.
I've merged this. I fixed one compiler warning and cleaned up some trailing whitespace. There is a compiler warning at numpy/core/src/multiarray/mapping.c:827:18: warning: comparison of distinct pointer types lacks a cast |
* BUG: Keep the integers uint32_t, add test
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from fa/ufunc_trivial_loop to labs-hpy-port * commit '61a4ed147547e5974971dc2bf6870a2777f0750c': Use try_trivial_single_output_loop in PyUFunc_GenericFunctionInternal Migrate function try_trivial_single_output_loop to HPy Migrate function prepare_ufunc_output to HPy Partially migrate function _check_ufunc_fperr to HPy Migrate function PyArray_EQUIVALENTLY_ITERABLE_OVERLAP_OK to HPy Migrate function check_for_trivial_loop to HPy Migrate function PyArray_CastToType to HPy Introduce HPyArray_CopyInto
feat: Add vmla_s8
These changes disable broadcasting by default as suggested by Jonathan Rocher, and add an alternative list-based subscript syntax as suggested by Josef. The syntax for the latter was inspired in part by some of George Nurser's syntax ideas.