-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
similar
calls undefined method with sparse matrices and dimensions other than 1 or 2
#23905
Comments
What is the problem here? And what would you have expected instead of a |
The problem here is that from this error message it is not really clear what the problem is (i. e. trying to create a 0D sparse array which is not possible). Instead the error message is about function Also, such limitation would IMHO warrant a mention in the documentation. The problem isn't the behaviour (throwing an error), but the clarity of the error message and the missing mention in the documentation |
Maybe |
That would make sense... This would need to be well thought through because you don't want this operation to accidentaly convert a sparse array to a dense one if that dense array is used anywhere else later on - that could cause some really cryptic errors for some edge cases (constructing 2D array from 0D arrays maybe?) |
So the failure mode the OP describes should be confined to The remaining question is whether the Thoughts? Best! |
On the other hand, the |
If it's used only in sparse operations, then I am against silent conversions. If it's not, I would opt for consistency. |
When trying to call
similar
on a sparse array with empty tuple as last argument, an error is thrown:AFAIK the underlying issue is that sparse arrays are defined only for 1D or 2D, so the call to
similar
(which should create a 0D sparse array) is meaningless. This behaviour is definitely undocumented and would benefit from a clearer error message (provided n-dimensional sparse arrays are not implemented in the future)The text was updated successfully, but these errors were encountered: