Fix beam_search memory leak. (#10185)
Fix beam_search memory leak. (#10185)


QiJune/Paddle,PaddlePaddle/Paddle,pkuyym/Paddle,reyoung/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,jacquesqiao/Paddle,putcn/Paddle,QiJune/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,baidu/Paddle,luotao1/Paddle,luotao1/Paddle,baidu/Paddle,chengduoZH/Paddle,Canpio/Paddle,Canpio/Paddle,QiJune/Paddle,putcn/Paddle,reyoung/Paddle,putcn/Paddle,baidu/Paddle,putcn/Paddle,reyoung/Paddle,QiJune/Paddle,QiJune/Paddle,jacquesqiao/Paddle,luotao1/Paddle,luotao1/Paddle,jacquesqiao/Paddle,chengduoZH/Paddle,jacquesqiao/Paddle,Canpio/Paddle,Canpio/Paddle,baidu/Paddle,chengduoZH/Paddle,pkuyym/Paddle,reyoung/Paddle,baidu/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,reyoung/Paddle,pkuyym/Paddle,tensor-tang/Paddle,PaddlePaddle/Paddle,Canpio/Paddle,putcn/Paddle,luotao1/Paddle,reyoung/Paddle,tensor-tang/Paddle,pkuyym/Paddle,tensor-tang/Paddle,pkuyym/Paddle,Canpio/Paddle,pkuyym/Paddle,putcn/Paddle,Canpio/Paddle,chengduoZH/Paddle,tensor-tang/Paddle,jacquesqiao/Paddle,jacquesqiao/Paddle,QiJune/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,Canpio/Paddle,tensor-tang/Paddle