Prevent computations in float16 in scalar and elemwise

Also add a bunch of tests
Ok. As this work now, we can keep it like this. Another possible way to fix
it would be to make composite don't pass python object. Not sure if this is
possible or not.

On Thu, Nov 6, 2014 at 1:43 PM, Pascal Lamblin <notifications@github.com>
wrote:

> In theano/tensor/nnet/sigm.py:
>
> > @@ -300,6 +308,11 @@ def static_impl(x):
> >              return 0.0
> >          if x > 30.0:
> >              return x
> > +        # If x is an int8 or uint8, numpy.exp will compute the result in
> > +        # half-precision (float16), where we want float32.
> > +        x_dtype = str(getattr(x, 'dtype', ''))
>
> When the impl is called from the perform of a composite Op, x is
> sometimes a python int or float
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/2228/files#r19964621>.
>