Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Need to change the attribute is_test of batch_norm op to true in test_program and inference_program

Open Xreki opened this issue 8 years ago • 2 comments

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 avatar Feb 11 '18 05:02 Xreki

@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.

kexinzhao avatar Feb 26 '18 19:02 kexinzhao

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.

Xreki avatar Feb 27 '18 07:02 Xreki