Theano/Theano — pull request #1737 by MarcCote (2014-02-17 21:05:23+00:00)
Title: Fixed memory leaks in cumsum and cumprod.

When calling PyArray_CumSum/PyArray_CumProd of the Numpy's C-API with an out parameter, it will create and return a new reference on the result array. To avoid memory leak, Py_XDECREF should be used after calling those functions.

Initially, I thought it was a bug, but it seems not: http://github.com/numpy/numpy/issues/4312