[BUG]fix gh-2348

when constant are used, we use the smallest dtype for them. But this
isn't enought when computing on them. So upcast to int64 to make sure
compuration is right.
The elemwise operation would take care of that. But I wasn't checking for
the uint64 case. I updated this PR for this case.
Normaly the extra cast now introduced would be fused by opt. So no need to
take care of the extra cast. Also there is an opt that upcast explicitly
the inputs.

The PR is updated

On Fri, Dec 19, 2014 at 2:17 PM, Pascal Lamblin <notifications@github.com>
wrote:

> In theano/tensor/basic.py
> <https://github.com/Theano/Theano/pull/2349#discussion-diff-22122880>:
>
> > @@ -4196,8 +4197,16 @@ def is_constant_value(var, value):
> >              if is_constant_value(start, 0):
> >                  return [(cast(stop, 'int64'),)]
> >              else:
> > +                if 'int' in stop.dtype:
> > +                    stop = cast(stop, 'int64')
> > +                elif 'int' in start.dtype:
>
> Why is this an elif rather than an if? should we not cast start even if
> stop was casted?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/2349/files#r22122880>.
>