[pypy-commit] pypy ufunc-reduce: another small simplification
rlamy
noreply at buildbot.pypy.org
Mon Jul 27 21:50:07 CEST 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: ufunc-reduce
Changeset: r78688:d3991d28b58a
Date: 2015-07-27 20:50 +0100
http://bitbucket.org/pypy/pypy/changeset/d3991d28b58a/
Log: another small simplification
diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py
--- a/pypy/module/micronumpy/loop.py
+++ b/pypy/module/micronumpy/loop.py
@@ -339,14 +339,14 @@
greens=['shapelen', 'func', 'dtype'],
reds='auto')
-def do_axis_reduce(space, shape, func, arr, dtype, axis, out, identity):
+def do_axis_reduce(space, func, arr, dtype, axis, out, identity):
out_iter = AxisIter(out.implementation, arr.get_shape(), axis)
out_state = out_iter.reset()
arr_iter, arr_state = arr.create_iter()
arr_iter.track_index = False
if identity is not None:
identity = identity.convert_to(space, dtype)
- shapelen = len(shape)
+ shapelen = len(out.get_shape())
while not out_iter.done(out_state):
axis_reduce_driver.jit_merge_point(shapelen=shapelen, func=func,
dtype=dtype)
diff --git a/pypy/module/micronumpy/ufuncs.py b/pypy/module/micronumpy/ufuncs.py
--- a/pypy/module/micronumpy/ufuncs.py
+++ b/pypy/module/micronumpy/ufuncs.py
@@ -410,7 +410,7 @@
if self.identity is not None:
out.fill(space, self.identity.convert_to(space, dtype))
return out
- loop.do_axis_reduce(space, shape, self.func, obj, dtype, axis,
+ loop.do_axis_reduce(space, self.func, obj, dtype, axis,
out, self.identity)
if call__array_wrap__:
out = space.call_method(obj, '__array_wrap__', out)
More information about the pypy-commit
mailing list