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

Enh: Accept "duck arrays" for tensordot #833

Open
brendan-m-murphy opened this issue Jan 9, 2025 · 0 comments
Open

Enh: Accept "duck arrays" for tensordot #833

brendan-m-murphy opened this issue Jan 9, 2025 · 0 comments
Labels
enhancement Indicates new feature requests needs triage Issue has not been confirmed nor labeled

Comments

@brendan-m-murphy
Copy link

Please describe the purpose of the new feature or describe the problem to solve.

Sparse's tensordot only allows multiplication between sparse arrays and either scipy sparse arrays or numpy ndarrays.

It would be useful if other array-like objects were allowed.

For instance, in xarray, the dot function can only multiply a sparse DataArray and a dask DataArray if the einsum/tensordot function from dask is used: pydata/xarray#9934

Suggest a solution if possible.

The code for multiplying a COO matrix and a np.ndarray in _dot seems like it mostly relies on being able to infer the dtype, index, and create empty ndarrays, so it seems plausible that other array-like objects could be used here.

I haven't tried to implement this though.

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

Please see this issue for further discussion in the context of xarray: pydata/xarray#9934

@brendan-m-murphy brendan-m-murphy added enhancement Indicates new feature requests needs triage Issue has not been confirmed nor labeled labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests needs triage Issue has not been confirmed nor labeled
Projects
None yet
Development

No branches or pull requests

1 participant