Fix crash du to opt that introduce cycle in the graph

NEWS.txt
Fix crash caused by an optimization that introduce cycle in the graph (Frederic Bastien, reported by Axel Davy)
I have a script that depend on pylearn2.

I'll pickle the parameter passed to function() and we can use this as a
tests. PL already did that. We need to mess with the pickle files to make
it smaller.

Fred


On Tue, Jun 10, 2014 at 10:07 PM, abergeron <notifications@github.com>
wrote:

> In theano/gof/opt.py:
>
> > +                # introduce node that depend on itself.  Doing the
> > +                # full check of such cycle everytimes is very time
> > +                # consumming. I think this double check is faster then
> > +                # doing the full cycle check. The full cycle check is
> > +                # skipped by validate() if the graph don't contain
> > +                # destroyers.
> > +                node = pairs[0][0]
> > +                candidate = pairs[0][1]
> > +                if node.owner and candidate.owner:
> > +                    node = node.owner
> > +                    candidate = candidate.owner
> > +                    inputs_match = all(node_in is cand_in
> > +                                       for node_in, cand_in in zip(
> > +                                           node.inputs, candidate.inputs))
> > +                    if not inputs_match or node.op != candidate.op:
> > +                        continue
>
> If I understand correctly this will check that for a replacement that is
> not equivalent to the source node (as in computes the same operation with
> the same inputs) and reject such a change.
>
> Do you have a test case where this happens?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1911/files#r13630892>.
>