Tokenization_utils doesn't work with Pytorch-Lightning on 2.10.0 version
# 🐛 Bug

## Information

Model I am using (Bert, XLNet ...): Bert with pytorch-lightning

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

The problem arises when using
*  my own modified scripts: Pytorch Dataset with tokenizer inside

The tasks I am working on is:
* my own task or dataset

## To reproduce

Take a look at [this colab link](https://colab.research.google.com/drive/1SH1xRzhNwgnSn382OLCoMFi_-8CCqk5y?usp=sharing). 

I've copied the method from pytorch-lightning which shows an error on 2.10.0 transformers when process a batch. Doing the same with transformers 2.8.0 cause no error.

```
/usr/local/lib/python3.6/dist-packages/transformers/tokenization_utils.py in __getattr__(self, item)
    201 
    202     def __getattr__(self, item: str):
--> 203         return self.data[item]
    204 
    205     def keys(self):

KeyError: 'cuda'
```

## Expected behavior

No error
     
- `transformers` version: 2.10.0
- Platform: Linux
- Python version: 3.6.9
- PyTorch version (GPU?): 1.5.0+cu101
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No
If you are using `pytorch-lightning`  then you won't need to transfer data on GPU or TPU manually. `lightning` takes care of that for you<|||||>I have copied the method, which transfer data from pytorch-lightning, so you can reproduce the error.<|||||>Okay, sorry I misunderstood the question.<|||||>It is my bad English, I guess. Do you need more explanation, or the question is clear now?<|||||>The reason is in latest version  `batch_encode_plus` returns an instance of `BatchEncoding` and in 2.8.0 it return a `dict`. So you can just do it like this
in your collate function
```
return dict(tokens), torch.tensor(labels, dtype=torch.long)
```

I think tokenizer should handle it itself, so tagging @mfuntowicz <|||||>BatchEncoding is indeed a UserDict, if you want to access the actual dict, you can use the data attribute:

```python
be = tokenizer.batch_encode_plus(...)
be.data
```<|||||>Thank you! So it's not a bug, but an expected behaviour