Need to change the attribute is_test of batch_norm op to true in test_program and inference_program
There is a kind of operators which behaves differently in training and testing phase. They holds a attribute is_test to distinguish the type of task, such as batch_norm_op and dropout_op. We need to set is_test to true in test_program and inference_program.
@Xreki The inference_optimize function can perform exactly this operation (no other optimization is performed).
Currently inference program will be inference optimized after pruning. Will change test program to be inference optimized as well.
Another issue is that inference_optimize can only handle non-RNN case (i.e., no multiple blocks).
Will create a issue to make it compatible with RNN.
Please let me know if you have other suggestions.
Thanks for your suggestions.
The inference_optimize function can perform exactly this operation (no other optimization is performed).
Currently inference program will be inference optimized after pruning. Will change test program to be inference optimized as well.
I think it is OK.
Another issue is that inference_optimize can only handle non-RNN case (i.e., no multiple blocks). Will create a issue to make it compatible with RNN.
I am not sure about this. The save/load may be rewritten in the near future. #8521 Let's how it will be.