PyTorch library dependency
## 🐛 Bug

<!-- Important information -->

Model I am using (Bert, XLNet....): XLNet

Language I am using the model on (English, Chinese....): English

```
pytorch_transformers\modeling_xlnet.py in forward(self, input_ids, token_type_ids, input_mask, attention_mask, mems, perm_mask, target_mapping, head_mask)
    925             # `1` indicates not in the same segment [qlen x klen x bsz]
    926             seg_mat = (token_type_ids[:, None] != cat_ids[None, :]).long()
--> 927             seg_mat = F.one_hot(seg_mat, num_classes=2).to(dtype_float)
    928         else:
    929             seg_mat = None

AttributeError: module 'torch.nn.functional' has no attribute 'one_hot'
```

## To Reproduce

Steps to reproduce the behavior:

1. Install pytprch 1.0.1 version
2. Use XLNet model to do the prediction.


'torch.nn.functional''s 'one_hot' function introduced from [1.1.0](https://pytorch.org/docs/1.1.0/nn.html#one-hot) while [requirements.txt](https://github.com/huggingface/pytorch-transformers/blob/master/requirements.txt#L2 ) requests 1.0.0+
I have the same issue with `pytorch 1.0.1`. When pytorch version is upgraded (to `1.2.0` for instance), this error is removed, however I get an import error:
```
ImportError: /opt/conda/lib/python3.7/site-packages/fused_layer_norm_cuda.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
```
<|||||>> I have the same issue with `pytorch 1.0.1`. When pytorch version is upgraded (to `1.2.0` for instance), this error is removed, however I get an import error:
> 
> ```
> ImportError: /opt/conda/lib/python3.7/site-packages/fused_layer_norm_cuda.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
> ```

My issue is fixed after upgrading pytorch to 1.2.0. Which model/ function do you call ?<|||||>For some reason, I had to reinstall apex after upgrading pytorch. <|||||>> For some reason, I had to reinstall apex after upgrading pytorch.

So have you fixed your ImportError？ I met this error when initializing BertAdam. I will try to migrate my code from pytorch-pretrained-bert to pytorch-transformers.<|||||>Yes, upgraded pytorch, then reinstalled apex.<|||||>> Yes, upgraded pytorch, then reinstalled apex.

Thank you. I will try.<|||||>Just to confirm, I had the same issue (ImportError). As @tayciryahmed said, re-installing apex would do the trick as it did for me :) <|||||>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.
