-
-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
usageUsage questionUsage question
Description
Please provide a description of what you'd like to do.
Hello,
I’ve run into an issue when using the Finch backend via pydata/sparse, specifically with libraries that expect NumPy-compatible dtypes (e.g. when calling np.dtype(...) on sparse arrays).
When I set os.environ["SPARSE_BACKEND"] = "Finch"
and create a COO array from a NumPy array:
import numpy as np
os.environ["SPARSE_BACKEND"] = "Finch"
import sparse
sa = sparse.COO.from_numpy(np.eye(4))
print(sa.dtype) # returns <class 'finch.tensor.Tensor'>
This causes downstream failures in libraries that assume they can call np.dtype(sa.dtype) with the following error TypeError: Cannot interpret 'Julia: Float64' as a data type.
So I have the following questions:
- Is returning 'Julia: Float64' as a dtype string intentional behavior?
- Are there plans to return NumPy-compatible dtype objects instead?
- Are there known workarounds for this kind of downstream compatibility issue?
I wasn’t able to find a discussion of this in the issue tracker, apologies if I missed it.
Thanks so much!
/cc @ilan-gold
Example Code
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
usageUsage questionUsage question