summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-06-14 13:44:02 -0400
committerCharles Harris <charlesr.harris@gmail.com>2015-06-14 13:44:02 -0400
commitb72d69ded7790da6ac0f351fe0ce8cf8187e562d (patch)
treef026d80d9825576dc938bfd40430caa2c01fe6bf /numpy/core
parenteaaa9313b3bf57196528c78868141bf106be9876 (diff)
parent190b8f0665084e458be8289748fa393824306193 (diff)
downloadnumpy-b72d69ded7790da6ac0f351fe0ce8cf8187e562d.tar.gz
Merge pull request #5966 from charris/test-einsum-small-boolean-arrays
TST: Test einsum for small boolean matrices.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/tests/test_einsum.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/core/tests/test_einsum.py b/numpy/core/tests/test_einsum.py
index 6aa20eb72..39b513731 100644
--- a/numpy/core/tests/test_einsum.py
+++ b/numpy/core/tests/test_einsum.py
@@ -608,5 +608,16 @@ class TestEinSum(TestCase):
np.einsum('ij,jk->ik', x, x, out=out)
assert_array_equal(out.base, correct_base)
+ def test_small_boolean_arrays(self):
+ # See gh-5946.
+ # Use array of True embedded in False.
+ a = np.zeros((16, 1, 1), dtype=np.bool_)[:2]
+ a[...] = True
+ out = np.zeros((16, 1, 1), dtype=np.bool_)[:2]
+ tgt = np.ones((2,1,1), dtype=np.bool_)
+ res = np.einsum('...ij,...jk->...ik', a, a, out=out)
+ assert_equal(res, tgt)
+
+
if __name__ == "__main__":
run_module_suite()