summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-09-09 22:55:43 +0300
committermattip <matti.picus@gmail.com>2019-09-09 22:55:43 +0300
commit4ee28be800ba23c2bda88b0dfa890eec9a9fc19f (patch)
treef3361f370b8828af8581ea722e6d87dd888e0b54 /numpy/core/tests
parent2903d86b9bdfa6310313296957a9672dbf953797 (diff)
downloadnumpy-4ee28be800ba23c2bda88b0dfa890eec9a9fc19f.tar.gz
MAINT: use tmp pointers to allow early break; add tests, release note
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_multiarray.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 2f2882ac4..05f01ad82 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -6279,10 +6279,20 @@ class TestMatmul(MatmulCommon):
def test_matmul_bool(self):
# gh-14439
a = np.array([[1, 0],[1, 1]], dtype=bool)
- assert np.max(a.view(np.int8)) == 1
+ assert np.max(a.view(np.uint8)) == 1
b = np.matmul(a, a)
# matmul with boolean output should always be 0, 1
- assert np.max(b.view(np.int8)) == 1
+ assert np.max(b.view(np.uint8)) == 1
+
+ rg = np.random.default_rng(np.random.PCG64(43))
+ d = rg.integers(2, size=4*5, dtype=np.int8)
+ d = d.reshape(4, 5) > 0
+ out1 = np.matmul(d, d.reshape(5, 4))
+ out2 = np.dot(d, d.reshape(5, 4))
+ assert_equal(out1, out2)
+
+ c = np.matmul(np.zeros((2, 0), dtype=bool), np.zeros(0, dtype=bool))
+ assert not np.any(c)
if sys.version_info[:2] >= (3, 5):