Add check on the output of NumPy.

done.

Fred


On Thu, Jul 17, 2014 at 8:45 AM, abergeron <notifications@github.com> wrote:

> In theano/tensor/extra_ops.py:
>
> > @@ -198,15 +217,21 @@ def c_code(self, node, name, inames, onames, sub):
> >                  if (!%(z)s)
> >                      %(fail)s;
> >                  {
> > -                    PyArray_CumProd(%(x)s, %(axis)s, 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_CumProd(
> > +                        %(x)s, %(axis)s,
> > +                        PyArray_TYPE((PyArrayObject*) py_%(x)s), %(z)s);
> > +                    if (!t){
> > +                       %(fail)s;
> > +                    }
> > +                    // Because PyArray_CumSum returns a newly created reference on %(t)s.
> > +                    Py_XDECREF(%(t)s);
>
> This should be t not %(t)s.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1972/files#r15054407>.
>