Created by: tonyyang-svail
This PR should be merged after #5139.
Fixes https://github.com/PaddlePaddle/Paddle/issues/5147