-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
matmul @ of boolean arrays gives inconsistent results #14439
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
Comments
It looks like the multiplication is being performed with the underlying integer data (i.e. False = 0, True = 1), and the resulting underlying values are not converted back to 0 and 1 afterwards. Eventually an underlying integer value overflows. This snippets prints
|
Hmmm, this seems like a bug. Matmul should probably conform with |
The dot behavior was discussed long ago, turned out that boolean matrix multiplication was useful for some subjects, so we should keep it. |
Uh oh!
There was an error while loading. Please reload this page.
Since the matrix A is its own square, the loop below should be infinite, but it terminates after 8 iterations. If
A = A.dot(A)
is used in place ofA = A @ A
, the loop is infinite as expected.Reproducing code example:
Numpy/Python version information:
1.16.0rc1 3.7.2 (default, Jan 3 2019, 02:55:40)
[GCC 8.2.0]
The text was updated successfully, but these errors were encountered: