Decouple the inference logic and training logic in Executor
Created by: reyoung
In the current Executor, the training logic and inference logic are mixed together. There are several problems.
-
The PR #10403 breaks the nested block training in Paddle because it early drops the kids, which would be used in backward.
-
The
create_vars
flag is not needed while training.
The solution is the inference engine will create a sub-class of Executor and rewrite some logic in sub-class. Not to use a boolean flag control it.