Hi all,

just a small heads up for gufunc hackers and low level iterator users.
We will probably very soon put in a commit into master that will allow
the removal of empty axis from NpyIter/nditer, effectively removing the
error:

"ValueError: cannot remove a zero-sized axis from an iterator"

and allowing:

```
arr = np.zeros((100, 0))
it = np.nditer((arr,),
               flags=["zerosize_ok", "multi_index"])
it.remove_axis(1)
```

As a follow up step, we also allow that gufuncs may be called with
empty inner loop sizes. In some cases that may mean that your gufuncs
may need special handling for lets say:

```
arr = np.zeros((100, 0))  # note the 0 dimension.
my_gufunc(arr)
```

If this creates problems for you, please tell, so that we can slow down
or undo the change. As an example, we have a matrix_multiply gufunc for
testing purpose, which did not zero out the output for the case of
`matrix_multiply(np.ones((10, 0)), np.ones((0, 10)))`. So this could
turn code that errored out for weird reasons into wrong results in rare
cases.

- Sebastian

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to