Massive text generation slowdown when using repetition_penalty param on GPU
# 🐛 Bug

## Information

Text generation when using the `repetition_penalty` takes about 2x-10x longer on a GPU, which is disproportionate and implies the GPU may not be used in that instance.

Reported from https://github.com/minimaxir/aitextgen/issues/34

The `enforce_repetition_penalty_` function at 

https://github.com/huggingface/transformers/blob/08c9607c3d025f9f1a0c40e6d124d5d5d446208e/src/transformers/modeling_utils.py#L817

may be using CPU ops instead of Tensor ops.

## To reproduce

Demo Colab notebook w/ time benchmarks: https://colab.research.google.com/drive/1SzYUEC0xikHN8OEp2WOTWHlT6JxT9rRf?usp=sharing



Thanks for the notebook - I can reproduce the results both on a local GPU and on colab. You are right, this slowdown is disproportionate! 
I'm suspecting the double for loop to be the reason for the heavy slow down. It might be possible to replace the two for loops by some smart matrix operations, but not sure.

Also pinging our PyTorch GPU master @mfuntowicz - do you maybe have some insight here?<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
