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.