Add check on the output of NumPy.

fixed. I ran the tests here, so it should be fine!


On Thu, Jul 17, 2014 at 11:37 AM, abergeron <notifications@github.com>
wrote:

> In theano/tensor/extra_ops.py:
>
> > @@ -74,13 +73,19 @@ def c_code(self, node, name, inames, onames, sub):
> >                  if (!%(z)s)
> >                      %(fail)s;
> >                  {
> > -                    PyArray_CumSum(%(x)s, NPY_MAXDIMS, PyArray_TYPE((PyArrayObject*) py_%(x)s), %(z)s);
> > -                    Py_XDECREF(%(z)s);  // Because PyArray_CumSum returns a newly created reference on %(z)s.
> > +                    PyObject * t = PyArray_CumSum(
> > +                        %(x)s, NPY_MAXDIMS,
> > +                        PyArray_TYPE((PyArrayObject*) py_%(x)s), %(z)s);
> > +                    if (!t){
> > +                       %(fail)s;
> > +                    }
> > +                    // Because PyArray_CumSum returns a newly created reference on %(t)s.
>
> The reference in the comments are making the format fail.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1972/files#r15064714>.
>