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

Verify SciPy canonical input #43

Merged
merged 1 commit into from
May 10, 2024
Merged

Verify SciPy canonical input #43

merged 1 commit into from
May 10, 2024

Conversation

mtsokol
Copy link
Member

@mtsokol mtsokol commented May 9, 2024

Hi @hameerabbasi,

When consuming SciPy sparse object, Finch expects it to be in a canonical format. When it's not true then array isn't loaded properly.

Here I verify that input is in canonical format and raise a proper warning.

@mtsokol mtsokol added the enhancement New feature or request label May 9, 2024
@mtsokol mtsokol self-assigned this May 9, 2024
@willow-ahrens
Copy link
Collaborator

does "canonical" mean "sorted"? just curious. thanks!

@mtsokol
Copy link
Member Author

mtsokol commented May 9, 2024

does "canonical" mean "sorted"? just curious. thanks!

Yes! finch-tensor requires it. I realized that creating SparseCOO with coords arrays that aren't sorted results in a broken Tensor (e.g. when densifying (copying to a dense Tensor) the resulting tensor is incorrect).

@hameerabbasi
Copy link
Collaborator

does "canonical" mean "sorted"? just curious. thanks!

Almost, sorted + no duplicate entries. 😄

@mtsokol mtsokol merged commit 477b5cd into main May 10, 2024
5 checks passed
@mtsokol mtsokol deleted the scipy-canonical branch May 10, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants