diff options
author | Stephan Hoyer <shoyer@climate.com> | 2015-03-01 14:23:07 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@climate.com> | 2015-03-01 14:29:58 -0800 |
commit | d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 (patch) | |
tree | 8f4c8c15dbebbd8bcba9406eeee9e2a2f6ead462 /numpy/lib/stride_tricks.py | |
parent | 50e4eb87370b77792f1f6d21a5edd6ff20abee68 (diff) | |
download | numpy-d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3.tar.gz |
BUG: fix broadcast_to for reference types
Diffstat (limited to 'numpy/lib/stride_tricks.py')
-rw-r--r-- | numpy/lib/stride_tricks.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py index 0f46ed335..a5f247abf 100644 --- a/numpy/lib/stride_tricks.py +++ b/numpy/lib/stride_tricks.py @@ -60,9 +60,9 @@ def _broadcast_to(array, shape, subok, readonly): if any(size < 0 for size in shape): raise ValueError('all elements of broadcast shape must be non-' 'negative') - broadcast = np.nditer((array,), flags=['multi_index', 'zerosize_ok'], - op_flags=['readonly'], itershape=shape, order='C' - ).itviews[0] + broadcast = np.nditer( + (array,), flags=['multi_index', 'refs_ok', 'zerosize_ok'], + op_flags=['readonly'], itershape=shape, order='C').itviews[0] result = _maybe_view_as_subclass(array, broadcast) if not readonly and array.flags.writeable: result.flags.writeable = True |