StopIteration Error when running beam search for squad 2.0
I'm using  `huggingface/transformers-pytorch-gpu:4.3.0` on Ubuntu DGX1 server with 8 V100 GPUs.
`NVIDIA-SMI 418.126.02   Driver Version: 418.126.02   CUDA Version: 10.1`

When running the step in `examples/question_answering/README.md` for beam search for squad 2.0

```
python run_qa_beam_search.py \
    --model_name_or_path xlnet-large-cased \
    --dataset_name squad_v2 \
    --do_train \
    --do_eval \
    --version_2_with_negative \
    --learning_rate 3e-5 \
    --num_train_epochs 4 \
    --max_seq_length 384 \
    --doc_stride 128 \
    --output_dir ./wwm_cased_finetuned_squad/ \
    --per_device_eval_batch_size=2  \
    --per_device_train_batch_size=2   \
    --save_steps 5000
```
Error 
```
StopIteration: Caught StopIteration in replica 0 on device 0.
Original Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
    output = module(*input, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/transformers/models/xlnet/modeling_xlnet.py", line 1978, in forward
    start_logits = self.start_logits(hidden_states, p_mask=p_mask)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_utils.py", line 1241, in forward
    if next(self.parameters()).dtype == torch.float16:
StopIteration
```
Indeed! I can reproduce, will fix.<|||||>Can you tell me if https://github.com/huggingface/transformers/pull/10215 fixes it? You can try by installing the following:

```
pip install git+https://github.com/huggingface/transformers@parameter-device-dtype
```<|||||>Thanks a lot for the quick fix. I'm running it right now. I will post whether the training is done in  ca. 7 hours.<|||||>> Can you tell me if #10215 fixes it? You can try by installing the following:
> 
> ```
> pip install git+https://github.com/huggingface/transformers@parameter-device-dtype
> ```

Hi, the issue is fixed. Thanks a lot. 