diff options
author | Stephan Hoyer <shoyer@gmail.com> | 2015-10-24 12:01:16 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@gmail.com> | 2015-10-24 12:13:04 -0700 |
commit | 9fa0dba63ac76a43a157e07c2a43f4678355653e (patch) | |
tree | c9235cac6ead75cd7d13a21c3c01afd36dedd051 /numpy/lib/tests/test_stride_tricks.py | |
parent | bf28b4432183126c21f0fa80852c335e9c1ed7c1 (diff) | |
download | numpy-9fa0dba63ac76a43a157e07c2a43f4678355653e.tar.gz |
BUG: error in broadcast_arrays with as_strided array
Fixes GH6491
Diffstat (limited to 'numpy/lib/tests/test_stride_tricks.py')
-rw-r--r-- | numpy/lib/tests/test_stride_tricks.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py index aad0695be..06e659002 100644 --- a/numpy/lib/tests/test_stride_tricks.py +++ b/numpy/lib/tests/test_stride_tricks.py @@ -390,6 +390,14 @@ def test_writeable(): _, result = broadcast_arrays(0, original) assert_equal(result.flags.writeable, False) + # regresssion test for GH6491 + shape = (2,) + strides = [0] + tricky_array = as_strided(np.array(0), shape, strides) + other = np.zeros((1,)) + first, second = broadcast_arrays(tricky_array, other) + assert_(first.shape == second.shape) + def test_reference_types(): input_array = np.array('a', dtype=object) |