Open
Description
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