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
BUG: matmul.at
segfaults
#21301
Comments
Thanks for reporting. That fix looks right modulo nitpicking (no following We could probably make the error message a bit easier to read, but I guess it is not really important here. |
Can I take on this pr? My plan is to check the signature of the ufunc and if it doesn't equal None, throw an error as a ufunc with an invalid signature shouldn't support the at function. |
There is a |
Sorry for not responding in a more timely manner. I removed the line continuation and indentation. Also, I added a simple test in I can make a PR for this stuff but, of course, I'm also happy if @alphabravo2001 further improves it. |
* Fixed numpy#21301 * Fixed numpy#21436, better error message, organized test cases as requested * Update numpy/core/src/umath/ufunc_object.c Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Describe the issue:
Calling
matmul.at
on arrays that pass all checks on shape, indices, etc, leads to a segmentation fault.Expected result
Calling other methods of ufuncs with a non-trivial signature raises either a
RuntimeError: Reduction not defined on ufunc with signature
or, in the case ofouter
, aTypeError: method outer is not allowed in ufunc with non-trivial signature
. Becauseat
is not a reduction, my expectation is getting aTypeError: method at is not allowed in ufunc with non-trivial signature
. I took the liberty to make the tiny adaption that implements the expected behavior here: dbeutel@6db8d96Reproduce the code example:
Error message:
NumPy/Python version information:
The text was updated successfully, but these errors were encountered: