refactored beam search according to torch implementation
refactored beam search according to torch implementation

huggingface/transformers,huggingface/pytorch-transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers