Skip to content
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

API: Add kwargs to sparse.einsum #620

Merged
merged 3 commits into from Jan 8, 2024
Merged

Conversation

mtsokol
Copy link
Collaborator

@mtsokol mtsokol commented Jan 7, 2024

Related issue: #589

Hi @hameerabbasi,

I think the original error was caused due to the fact that np.einsum has kwargs which is missing in sparse.einsum. There is no Array API standard definition for einsum function so maybe we can just add **kwargs to sparse.einsum to make it compatible.

If there are plans for refactoring sparse.einsum in the future, then there will be an opportunity to introduce dtype parameter.

@mtsokol mtsokol self-assigned this Jan 7, 2024
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

Merging #620 (4850f56) into master (925112f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #620   +/-   ##
=======================================
  Coverage   90.36%   90.36%           
=======================================
  Files          20       20           
  Lines        3601     3603    +2     
=======================================
+ Hits         3254     3256    +2     
  Misses        347      347           

@hameerabbasi
Copy link
Collaborator

While the optimize kwarg certainly isn't urgent as it doesn't change the result, I'd consider the dtype kwarg to be sufficiently important to coerce all the inputs to it before an operation.

@mtsokol
Copy link
Collaborator Author

mtsokol commented Jan 8, 2024

While the optimize kwarg certainly isn't urgent as it doesn't change the result, I'd consider the dtype kwarg to be sufficiently important to coerce all the inputs to it before an operation.

Sure! I added dtype parameter and input operators are mapped to it with astype.

@hameerabbasi hameerabbasi merged commit d6d1b19 into pydata:master Jan 8, 2024
13 checks passed
@hameerabbasi
Copy link
Collaborator

Thanks, @mtsokol!

@mtsokol mtsokol deleted the einsum-kwargs branch January 8, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants