1. Pypy
  2. Untitled project
  3. pypy

Commits

Matti Picus  committed c5b5187

copy logic from getitem_filter to setitem_filter

  • Participants
  • Parent commits 799a5ad
  • Branches default

Comments (0)

Files changed (1)

File pypy/module/micronumpy/loop.py

View file
  • Ignore whitespace
 
 def setitem_filter(arr, index, value, size):
     arr_iter = arr.create_iter()
-    index_iter = index.create_iter(index.get_shape())
+    shapelen = len(arr.get_shape())
+    if shapelen > 1 and len(index.get_shape()) < 2:
+        index_iter = index.create_iter(arr.get_shape(), backward_broadcast=True)
+    else:
+        index_iter = index.create_iter()
     value_iter = value.create_iter([size])
-    shapelen = len(arr.get_shape())
     index_dtype = index.get_dtype()
     arr_dtype = arr.get_dtype()
     while not index_iter.done():