Theano/Theano — Issue #129: Don't downcast shape dimensions to int32 in random.
Author: nouiz
Created: 2011-10-20 15:34:44+00:00
State: open

I found that we always cast to int32 the shape in code related to ramdom. This prevent one dimensions to be higher then 2e32. This will also be silent error. Below is the email that discuss this finding, but I saw more case like that. We should find a way to cast to ~PySizet or cast to int32 only on 32 bits python.

> There is one question I have about this graph: why there is a cast to
> int32 on the shape before doing to the RandomFunction? James do you
> know the answer? That could cause problem if the shape don't fix in
> int32 in one of the dimensions.
>
> From the file raw_random.py around line 450, this was added by you
> James. I think we should modify this to do the fix only on 32 bits
> python installation. What do you think? On 32 bits computer
> Py_SizeT(or similar) is 32 bits I think, so the fix is safe, but I
> think that on python 64 bits, this Py_SizeT is 64 bits.
>
Sure, 64 bit sizes on 64 bit computers would be better.