-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support opt_einsum in xr.dot #7764
Comments
I support this (seems just like what we do for bottleneck) but maybe don't use the word def dot(..., einsum_func=np.einsum):
.... |
Is there ever a case where it would be preferable to use numpy if opt_einsum were installed? If not, I would propose that, like bottleneck, we just automatically use it if available. |
we still want to be able to explicitly switch it off as we did for bottleneck (mostly for debugging purposes), so the kwarg / option would be good to have either way. |
|
I think I agree with |
Allowing for explicitly passing a function matching the The overhead from optimizing contraction paths is probably very small relative to the overhead of Xarray in general, so I would support setting |
Apparently not all backends support |
Closes pydata#7764 Closes pydata#8017
* Use `opt_einsum` by default if installed. Closes #7764 Closes #8017 * docstring update * _ * _ Co-authored-by: Maximilian Roos <[email protected]> * Update xarray/core/computation.py Co-authored-by: Maximilian Roos <[email protected]> * Fix docs? * Add use_opt_einsum option. * mypy ignore * one more test ignore * Disable navigation_with_keys * remove intersphinx * One more skip --------- Co-authored-by: Maximilian Roos <[email protected]>
Is your feature request related to a problem?
Shall we support opt_einsum as an optional backend for
xr.dot
?opt_einsum.contract
is a drop-in replacement fornp.einsum
so this monkey-patch works todayDescribe the solution you'd like
Add a
backend
kwarg with options"numpy"
and"opt_einsum"
, with the default being"numpy"
Describe alternatives you've considered
We could create a new package but it seems a bit silly.
Additional context
No response
The text was updated successfully, but these errors were encountered: