Created by: sidgoyal78
This is basically a first step towards removing pickle altogether.
In order to run @Xreki's example from PR #7097 , we need "picklingtools" which doesn't seem to be well maintained. So this PR enables us to not use picklingtools and still run the inference example on our machines.
The 2 main things are:
- We are now saving the ProgramDesc of the inference_program to a binary file (in addition to the 3 things stored by Pickling).
- The else block IFDEF code in #7097 (https://github.com/PaddlePaddle/Paddle/pull/7097/files#diff-8b842e8c9f4dd56d96360645246a94c7R40) is modified to read the binary file.
As mentioned earlier, our bigger goal is to remove pickle altogether, and @kexinzhao is working on clubbing the 3 things: programDesc of inference, feed vars, and fetch vars into a unified protobuf. (Issue #7221 (closed)). So this is more like a step 1, just to avoid "picklingtools".