Module Expr Str Import alias Import alias Import alias identifier ImportFrom alias alias Import alias Import alias identifier Assign NameStore Str FunctionDef arguments args defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIn NameLoad ListLoad Str Str body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd BinOpPow NameLoad Num NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index NameLoad BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad finalbody Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIn NameLoad ListLoad Str Str body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr BinOpAdd BinOpPow NameLoad Num NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index NameLoad BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num keyword NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad finalbody Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Expr Call NameLoad
N/A N/A 
This script tests the pickle and unpickle of theano functions.
When a compiled theano has shared vars, their values are also being pickled.

Side notes useful for debugging:
The pickling tools theano uses is here:
theano.compile.function_module._pickle_Function()
theano.compile.function_module._pickle_FunctionMaker()
Whether reoptimize the pickled function graph is handled by
FunctionMaker.__init__()
The config option is in configdefaults.py

This note is written by Li Yao.
 N/A unittest N/A numpy N/A six.moves.cPickle pickle theano.compat DictMixin OrderedDict N/A theano N/A theano.tensor T N/A floatX float32 test_pickle_unpickle_with_reoptimization N/A N/A N/A N/A N/A mode N/A N/A theano config mode N/A N/A mode N/A DEBUG_MODE DebugMode N/A N/A mode FAST_RUN N/A x1 N/A N/A T fmatrix x1 N/A x2 N/A N/A T fmatrix x2 N/A x3 N/A N/A theano shared N/A N/A numpy ones N/A 10 10 dtype floatX N/A x4 N/A N/A theano shared N/A N/A numpy ones N/A 10 10 dtype floatX N/A y N/A N/A T sum N/A N/A N/A T sum N/A N/A N/A T sum N/A N/A x1 2 x2 x3 x4 N/A updates N/A OrderedDict N/A N/A updates N/A x3 N/A x3 1 N/A N/A updates N/A x4 N/A x4 1 N/A f N/A N/A theano function N/A x1 x2 y updates updates mode mode N/A string_pkl N/A N/A pickle dumps f -1 N/A in1 N/A N/A numpy ones N/A 10 10 dtype floatX N/A in2 N/A N/A numpy ones N/A 10 10 dtype floatX N/A default N/A N/A theano config reoptimize_unpickled_function N/A N/A N/A N/A N/A theano config reoptimize_unpickled_function True N/A f_ N/A N/A pickle loads string_pkl N/A N/A N/A f in1 in2 N/A f_ in1 in2 N/A N/A N/A N/A theano config reoptimize_unpickled_function default N/A test_pickle_unpickle_without_reoptimization N/A N/A N/A N/A N/A mode N/A N/A theano config mode N/A N/A mode N/A DEBUG_MODE DebugMode N/A N/A mode FAST_RUN N/A x1 N/A N/A T fmatrix x1 N/A x2 N/A N/A T fmatrix x2 N/A x3 N/A N/A theano shared N/A N/A numpy ones N/A 10 10 dtype floatX N/A x4 N/A N/A theano shared N/A N/A numpy ones N/A 10 10 dtype floatX N/A y N/A N/A T sum N/A N/A N/A T sum N/A N/A N/A T sum N/A N/A x1 2 x2 x3 x4 N/A updates N/A OrderedDict N/A N/A updates N/A x3 N/A x3 1 N/A N/A updates N/A x4 N/A x4 1 N/A f N/A N/A theano function N/A x1 x2 y updates updates mode mode N/A string_pkl N/A N/A pickle dumps f -1 N/A in1 N/A N/A numpy ones N/A 10 10 dtype floatX N/A in2 N/A N/A numpy ones N/A 10 10 dtype floatX N/A default N/A N/A theano config reoptimize_unpickled_function N/A N/A N/A N/A N/A theano config reoptimize_unpickled_function False N/A f_ N/A N/A pickle loads string_pkl N/A N/A N/A f in1 in2 N/A f_ in1 in2 N/A N/A N/A N/A theano config reoptimize_unpickled_function default N/A N/A N/A __name__ __main__ N/A N/A N/A test_pickle_unpickle_with_reoptimization N/A N/A test_pickle_unpickle_without_reoptimization