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
Ufunc where parameter causes array to be silently read out of bounds #9886
Comments
Are you sure it's a read out of bounds? It can also be just
uninitialized memory (because where=False for the element, no value is
set to it and it is not zeroed).
|
A pretty simple test is to reverse the
An out of bounds error shouldn't mess up for entry |
OK, now I understand. Since the where is broadcast with the argument, the output get the length of the wider. The output array is allocated but not initialized. Because the function is not computed where "where" is false, some buckets in the output remain uninitialized. Makes sense, sorry for the noise. Wonder if the documentation could be enriched a little. |
You're right, the descriptions don't suggest that at all right now. The relevant docstrings are in What you're seeing is the interaction between Feel free to submit a patch with improved wording, or even just file an issue suggesting the new docstring. |
When the
where
argument of aufunc
has a shape that exceeds that of the input argument of the ufunc, arrays are silently read out of bounds. For instanceIs this the intended behavior?
The text was updated successfully, but these errors were encountered: