diff options
author | mattip <matti.picus@gmail.com> | 2019-09-09 16:39:46 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-09-09 16:44:27 +0300 |
commit | 2903d86b9bdfa6310313296957a9672dbf953797 (patch) | |
tree | f8f798978fef3c1610ce81903c7b01d6e113996c /numpy/core/tests | |
parent | 42ac121a0b547bc7c218c7ea318caf6c0a420034 (diff) | |
download | numpy-2903d86b9bdfa6310313296957a9672dbf953797.tar.gz |
BUG: add a specialized loop for boolean matmul
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 1b698b517..2f2882ac4 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -6276,6 +6276,13 @@ class TestMatmul(MatmulCommon): with assert_raises(TypeError): b = np.matmul(a, a) + def test_matmul_bool(self): + # gh-14439 + a = np.array([[1, 0],[1, 1]], dtype=bool) + 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 if sys.version_info[:2] >= (3, 5): |