diff options
author | Stephan Hoyer <shoyer@climate.com> | 2015-05-15 01:14:18 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@climate.com> | 2015-05-15 01:14:18 -0700 |
commit | aa50162b58e0226bf4f5c21ee1d74a94e85cd6d7 (patch) | |
tree | 69055d6029c586d6c9ac59dda95f95a31c779e76 /numpy/lib/tests/test_stride_tricks.py | |
parent | 0174f2ae5d9efc7d7459c20c99e31ace20a341ed (diff) | |
download | numpy-aa50162b58e0226bf4f5c21ee1d74a94e85cd6d7.tar.gz |
BUG: fix _broadcast_shape (and broadcast_array) for len(args) > 32
Fixes gh-5862
Diffstat (limited to 'numpy/lib/tests/test_stride_tricks.py')
-rw-r--r-- | numpy/lib/tests/test_stride_tricks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py index e079e0bf4..44112c970 100644 --- a/numpy/lib/tests/test_stride_tricks.py +++ b/numpy/lib/tests/test_stride_tricks.py @@ -273,6 +273,11 @@ def test_broadcast_shape(): assert_equal(_broadcast_shape(*([np.ones((1, 2))] * 32)), (1, 2)) assert_equal(_broadcast_shape(*([np.ones((1, 2))] * 100)), (1, 2)) + # regression tests for gh-5862 + assert_equal(_broadcast_shape(*([np.ones(2)] * 32 + [1])), (2,)) + bad_args = [np.ones(2)] * 32 + [np.ones(3)] * 32 + assert_raises(ValueError, lambda: _broadcast_shape(*bad_args)) + def test_as_strided(): a = np.array([None]) |