'Size' Error while loading t5-large model
Author: monk1337
Pull request: no

# 🐛 Bug

## Information

Model I am using t5-large:

Language I am using the model on English

The problem arises when using:
```
from transformers import T5Tokenizer, T5Model

tokenizer   = T5Tokenizer.from_pretrained('t5-large')
model       = T5Model.from_pretrained('t5-large')

input_ids   = tokenizer('sentence embeddings from t5 model', return_tensors="pt")
outputs     = model(input_ids=input_ids, decoder_input_ids=input_ids)
```

Error message :

```
KeyError: 'size'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-2-0ba21adf6547> in <module>
      1 input_ids   = tokenizer('chyuu wow this is working', return_tensors="pt")
----> 2 outputs     = model(input_ids=input_ids, decoder_input_ids=input_ids)

~/tfproject/tfenv/lib/python3.7/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    548             result = self._slow_forward(*input, **kwargs)
    549         else:
--> 550             result = self.forward(*input, **kwargs)
    551         for hook in self._forward_hooks.values():
    552             hook_result = hook(self, input, result)

~/tfproject/tfenv/lib/python3.7/site-packages/transformers/modeling_t5.py in forward(self, input_ids, attention_mask, encoder_outputs, decoder_input_ids, decoder_attention_mask, decoder_past_key_value_states, use_cache, inputs_embeds, decoder_inputs_embeds, head_mask, output_attentions, output_hidden_states)
    949                 head_mask=head_mask,
    950                 output_attentions=output_attentions,
--> 951                 output_hidden_states=output_hidden_states,
    952             )
    953 

~/tfproject/tfenv/lib/python3.7/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    548             result = self._slow_forward(*input, **kwargs)
    549         else:
--> 550             result = self.forward(*input, **kwargs)
    551         for hook in self._forward_hooks.values():
    552             hook_result = hook(self, input, result)

~/tfproject/tfenv/lib/python3.7/site-packages/transformers/modeling_t5.py in forward(self, input_ids, attention_mask, encoder_hidden_states, encoder_attention_mask, inputs_embeds, head_mask, past_key_value_states, use_cache, output_attentions, output_hidden_states)
    676             raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
    677         elif input_ids is not None:
--> 678             input_shape = input_ids.size()
    679             input_ids = input_ids.view(-1, input_shape[-1])
    680         elif inputs_embeds is not None:

~/tfproject/tfenv/lib/python3.7/site-packages/transformers/tokenization_utils_base.py in __getattr__(self, item)
    185             return self.data[item]
    186         except KeyError:
--> 187             raise AttributeError
    188 
    189     def __getstate__(self):

AttributeError: 
```

The tasks I am working on is:

Getting sentence representation

## To reproduce


## Environment info
     
- `transformers` version:
- Platform: Ubuntu 18.04
- Python version: python3.7
- PyTorch version (GPU?): 1.5.1 
- Tensorflow version (GPU?): 1.14
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No


Comments:
Hi! This is because the return of `tokenizer('sentence embeddings from t5 model', return_tensors="pt")` is a dict containing values that can be used by the model. It's not a tensor, so it's not `input_ids`.

Change the following line:
```py
tokenizer('sentence embeddings from t5 model', return_tensors="pt")
```
to
```py
tokenizer('sentence embeddings from t5 model', return_tensors="pt")["input_ids"]
```
to make it work.

You can check the documentation [here](https://huggingface.co/transformers/main_classes/tokenizer.html#transformers.PreTrainedTokenizer.__call__).