Issue 1763

Fixes #1763
(or more accurately it will when it is ok)

Replaces closed pull request #2286.
Why this code is commented? I think you need to call inplace_increment like this:

inplace_increment(NULL, arglist).

It is not said in the doc if PyTuple_Pack stole a refence to x, idx, and y. So if you have strange cresh, just add an incref to the 3 inputs.


@abergeron numpy do not have a c-api for this. There is a c function defined in cutils in Theano called inplace_increment. We should call it directly.

For this, it need numpy 1.8 or more. To do the check correctly, before returting in c_code(), check if inplace_increment is None. If so, raise NotImplementedError(). This will cause a fallback to the python code.