Conversation
host() sizes its buffer from elements(), which reports the dense shape for a sparse array, but af_get_data_ptr then rejected the array with "Expected: info->isSparse() == false". Convert to dense first and copy that, and say so in the docs. Fixes #3703.
CSC to dense is not implemented, so host() on a CSC array now fails with AF_ERR_NOT_SUPPORTED and a message instead of an argument error from deep inside the conversion. The docs say CSR and COO. The test gains an fp64 guard and a case that compares host() against the dense source for CSR and COO and expects the CSC rejection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling host() on a sparse array threw:
host() sizes its buffer from elements(), which already reports the dense shape for a sparse array, so af_get_data_ptr now converts CSR and COO arrays to dense and copies that. CSC to dense is not implemented anywhere, so a CSC array fails with AF_ERR_NOT_SUPPORTED and a message saying to convert to CSR or COO first; the C++ and C docs say the same. Callers who relied on the old error to detect sparse arrays now get data instead, which is worth a line in the release notes. Tests cover the reported case and compare host() against the dense source for CSR and COO; the sparse suite passes on the CPU backend (88 tests). Fixes #3703.