WIP: Masked arrays

Before I start implementing all the operations for masked arrays, it'd be great if someone (e.g. @nouiz) could let me know whether this is correct i.e. whether the files are in the correct place, whether I derived from the correct classes, etc. This is my first attempt at a PR to Theano, so I'm not sure how some things should be done.
Put this as a comment.

On Sat, Oct 25, 2014 at 2:40 AM, Bart van Merriënboer <
notifications@github.com> wrote:

> In theano/masked/basic.py:
>
> > +        return Apply(self, [data, mask],
> > +                     [MaskedTensorVariable(data.type)])
> > +
> > +    def perform(self, node, (data, mask), (out,)):
> > +        out[0] = np.ma.array(data, mask=mask)
> > +
> > +
> > +class GetMask(Op):
> > +    view_map = {0: [0]}
> > +
> > +    def make_node(self, ma):
> > +        return Apply(self, [ma],
> > +                     [ma.mask_ttype.make_variable()])
> > +
> > +    def perform(self, node, (ma,), (out,)):
> > +        out[0] = ma.mask.view('int8')
>
> Masks are stored as boolean arrays by NumPy, which causes Theano to give
> an error; it says something like expected NPY_INT8 (num_type 1) but got
> num_type 0. Hence the view as int8 (just a view is enough because boolean
> values are stored as int8 by NumPy anyway).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/2209/files#r19374215>.
>