summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorseberg <sebastian@sipsolutions.net>2016-09-02 10:20:24 +0200
committerGitHub <noreply@github.com>2016-09-02 10:20:24 +0200
commit8eedd3e911b7e3f5f35961871ddb8ee1559d4225 (patch)
treecfe1aa43b2e527ee7dd403f6990f4dcf5260cb51 /numpy/testing/utils.py
parenta93d9f7a97358e618aa52b2bbfa119317ee56d08 (diff)
parentd555a0ad0f1191daf8ae83e10933da5556b2510e (diff)
downloadnumpy-8eedd3e911b7e3f5f35961871ddb8ee1559d4225.tar.gz
Merge pull request #7999 from juliantaylor/inplace-opt
ENH: add inplace cases to fast ufunc loop macros
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index c7f4a0aa7..9c432f3dc 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -1794,7 +1794,8 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24):
inp = lambda: arange(s, dtype=dtype)[o:]
out = empty((s,), dtype=dtype)[o:]
yield out, inp(), ufmt % (o, o, s, dtype, 'out of place')
- yield inp(), inp(), ufmt % (o, o, s, dtype, 'in place')
+ d = inp()
+ yield d, d, ufmt % (o, o, s, dtype, 'in place')
yield out[1:], inp()[:-1], ufmt % \
(o + 1, o, s - 1, dtype, 'out of place')
yield out[:-1], inp()[1:], ufmt % \
@@ -1809,9 +1810,11 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24):
out = empty((s,), dtype=dtype)[o:]
yield out, inp1(), inp2(), bfmt % \
(o, o, o, s, dtype, 'out of place')
- yield inp1(), inp1(), inp2(), bfmt % \
+ d = inp1()
+ yield d, d, inp2(), bfmt % \
(o, o, o, s, dtype, 'in place1')
- yield inp2(), inp1(), inp2(), bfmt % \
+ d = inp2()
+ yield d, inp1(), d, bfmt % \
(o, o, o, s, dtype, 'in place2')
yield out[1:], inp1()[:-1], inp2()[:-1], bfmt % \
(o + 1, o, o, s - 1, dtype, 'out of place')