Pickle and Unpickle theano functions

Added a test case to verify if pickle and unpickle a compiled theano function works.
Passed.

This is the follow up of gh-1945
On Wed, Oct 15, 2014 at 12:28 PM, Frédéric Bastien <notifications@github.com
> wrote:

> In theano/tests/test_pickle_unpickle_theano_fn.py:
>
> > +
> > +def test_pickle_unpickle_without_reoptimization():
> > +    x1 = T.fmatrix('x1')
> > +    x2 = T.fmatrix('x2')
> > +    x3 = theano.shared(numpy.ones((10,10),dtype=floatX))
> > +    x4 = theano.shared(numpy.ones((10,10),dtype=floatX))
> > +    y = T.sum(T.sum(T.sum(x1**2+x2) + x3) + x4)
> > +
> > +    updates = OrderedDict()
> > +    updates[x3] = x3 + 1
> > +    updates[x4] = x4 + 1
> > +    f = theano.function([x1,x2],y, updates=updates)
> > +
> > +    # now pickle the compiled theano fn
> > +    pkl_path = open('thean_fn.pkl','wb')
> > +    cPickle.dump(f, pkl_path, -1)
>
> Don't pickle to a file. It pollute the file system. You can pickle to a
> string with dumps and load from a string loads.
>
What do you mean exactly?

> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/2139/files#r18904893>.
>