numpy.asarray(self._sum) return a ndarray that is hashable. The sum() call
will transform it in python type of the right type (real/int/long)


On Mon, Nov 25, 2013 at 9:08 AM, Pascal Lamblin <notifications@github.com>wrote:

> In theano/tensor/var.py:
>
> > @@ -605,6 +605,10 @@ def _get_sum(self):
> >              return self._sum
> >          except AttributeError:
> >              self._sum = self.no_nan.sum()
> > +            # The following 2 lines are needede as in Python 3.3 with NumPy
> > +            # 1.7.1, numpy.ndarray and numpy.memmap aren't hashable.
> > +            if type(self._sum) is numpy.memmap:
> > +                self._sum = numpy.asarray(self._sum).sum()
>
> Why do you need to call sum() a second time?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Theano/Theano/pull/1623/files#r7891064>
> .
>