[pypy-commit] pypy numpypy-nditer: fix merge, redo changes to shape_agreement_multiple

mattip noreply at buildbot.pypy.org
Thu Apr 17 19:11:41 CEST 2014


Author: Matti Picus <matti.picus at gmail.com>
Branch: numpypy-nditer
Changeset: r70710:502dcbfd997e
Date: 2014-04-17 20:02 +0300
http://bitbucket.org/pypy/pypy/changeset/502dcbfd997e/

Log:	fix merge, redo changes to shape_agreement_multiple

diff --git a/pypy/module/micronumpy/strides.py b/pypy/module/micronumpy/strides.py
--- a/pypy/module/micronumpy/strides.py
+++ b/pypy/module/micronumpy/strides.py
@@ -282,14 +282,16 @@
 
 
 @jit.unroll_safe
-def shape_agreement_multiple(space, array_list):
+def shape_agreement_multiple(space, array_list, shape=None):
     """ call shape_agreement recursively, allow elements from array_list to
     be None (like w_out)
     """
-    shape = array_list[0].get_shape()
-    for arr in array_list[1:]:
+    for arr in array_list:
         if not space.is_none(arr):
-            shape = shape_agreement(space, shape, arr)
+            if shape is None:
+                shape = arr.get_shape()
+            else:    
+                shape = shape_agreement(space, shape, arr)
     return shape
 
 


More information about the pypy-commit mailing list