[Numpy-discussion] slight MapIter change
Frédéric Bastien
nouiz at nouiz.org
Mon May 13 09:58:07 EDT 2013
Hi,
this is used in Theano. What is the consequence of not doing this? There is
people that use it, the question is how many.
Is there a way to detect witch version need to be used?
thanks
Fred
On Sat, May 11, 2013 at 11:41 AM, Sebastian Berg <sebastian at sipsolutions.net
> wrote:
> Hey,
>
> (this is only interesting if you know what MapIter and actually use it)
>
> In case anyone already uses the newly exposed mapiter (it was never
> released yet). There is a tiny change, which only affects indexes that
> start with np.newaxis but otherwise just simplifies a tiny bit. The old
> block for swapping axes should be changed like this:
>
> if ((mit->subspace != NULL) && (mit->consec)) {
> - if (mit->iteraxes[0] > 0) {
> - PyArray_MapIterSwapAxes(mit, (PyArrayObject **)&arr, 0);
> - if (arr == NULL) {
> - return -1;
> - }
> + PyArray_MapIterSwapAxes(mit, (PyArrayObject **)&arr, 0);
> + if (arr == NULL) {
> + return -1;
> }
> }
>
> Regards,
>
> Sebastian
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130513/477e99a5/attachment.html>
More information about the NumPy-Discussion
mailing list