Repository navigation
BUG: add a specialized loop for boolean matmul - #14464
Conversation
| assert np.max(a.view(np.int8)) == 1 | ||
| b = np.matmul(a, a) | ||
| # matmul with boolean output should always be 0, 1 | ||
| assert np.max(b.view(np.int8)) == 1 |
There was a problem hiding this comment.
Could be nice to have a larger than 2x2 array as well I guess. And while we are at it, ensure:
np.matmul(np.empty((2, 0), dtype=np.bool_), np.empty(0, dtype=np.bool_))
gives [False, False] (that is what dot gives, I assume it is correct, heh).
There was a problem hiding this comment.
Should probably view as uint8 here, since currently this test won't detect -1
There was a problem hiding this comment.
fixed uint8, added more tests. np.empty gives uninitialized memory, used np.zeros instead.
If cblas couldn't be used, it was done with einsum |
|
Put release note label, but since this is going to be backported and the backports have the shortlist, and it is pretty obvious, maybe that is unnecessary. |
|
There are compiler warnings... |
|
grr. We should move the compiler-warning-check code from |
|
tests pass |
|
OK, lets put this in. Thanks Matti! |
Fixes gh-14439
Not sure whether this should be labelled a bug or a regression, since the original matmul was based on dot and so most likely worked properly. If a regression the test should move to the proper place.