Default dtype in MRG_RandomStreams binomial and multinomial methods
It is currently int64, which sounds arbitrary, would it be a good idea for the default value to depend on the 'n' argument instead?
Basically the idea would be to use None as default value, then:
if dtype is None:
dtype = theano.tensor.constant(n).dtype
I wouldn't do it before 0.4 though, since the current default implementation of tensor.constant would make the dtype vary wildly depending on the value of n (which could be seen as a good thing, but I think it is dangerous).
This proposition may be considered as dangerous as well though (because one may use a typed n without knowing about it), in which case my other suggestion would be to use int64 on 64-bit machines, but int32 on 32-bit machines.
Feel free to comment.
Basically the idea would be to use None as default value, then:
if dtype is None:
dtype = theano.tensor.constant(n).dtype
I wouldn't do it before 0.4 though, since the current default implementation of tensor.constant would make the dtype vary wildly depending on the value of n (which could be seen as a good thing, but I think it is dangerous).
This proposition may be considered as dangerous as well though (because one may use a typed n without knowing about it), in which case my other suggestion would be to use int64 on 64-bit machines, but int32 on 32-bit machines.
Feel free to comment.
Leave a comment