[Generate] Facilitate PyTorch generate using `ModelOutputs`
Author: patrickvonplaten
Pull request: yes

This PR: 
- forces to use `return_dict=True` for generation in PyTorch. This should not lead to any problem because .generate() cannot be used to compute gradients 
- The handling of `encoder_outputs` is simplified for Bart, T5 and the Encoder. Previously, there was an ugly hack that forces the second position of the encoder/decoder outputs for T5 and Bart to be a tuple containing both `decoder_past_key_values` and `encoder_outputs` whereas `encoder_outputs` was a duplicated output. With the new cleaner API, only the `decoder_past_key_values` are returned because the `encoder_outputs` can be accessed differently.
- Fixes #6319 
- Adds better documentation for the Encoder Decoder model + test + better example
- Most importantly, this PR lays the groundwork for a better GenerationOutput object (@sgugger). Returning a list of all attentions and all hidden states when using `.generate()` was a feature many people asked for. This will now be made possible by forcing to use "return_dict" in .generate() so that "decoder_attentions" and "attentions" can be accessed by keyword.

**Important**: The new handling of `encoder_outputs` introduces a small breaking change in that "output[1]" is now not a mixed tuple of encoder_outputs and `decoder_past_key_values`, but only `decoder_past_key_values`, whereas the encoder_outputs can be accessed as before. 

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=h1) Report
> Merging [#6735](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/a32d85f0d405be53117b96075eef2875d2185892?el=desc) will **decrease** coverage by `1.02%`.
> The diff coverage is `78.33%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/6735/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #6735      +/-   ##
==========================================
- Coverage   80.48%   79.46%   -1.03%     
==========================================
  Files         157      157              
  Lines       28794    28822      +28     
==========================================
- Hits        23175    22903     -272     
- Misses       5619     5919     +300     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `94.24% <50.00%> (-1.35%)` | :arrow_down: |
| [src/transformers/modeling\_t5.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190NS5weQ==) | `76.70% <57.14%> (-7.14%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_t5.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl90NS5weQ==) | `89.57% <70.27%> (-1.37%)` | :arrow_down: |
| [src/transformers/modeling\_encoder\_decoder.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19lbmNvZGVyX2RlY29kZXIucHk=) | `92.00% <93.33%> (-0.40%)` | :arrow_down: |
| [src/transformers/generation\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3V0aWxzLnB5) | `96.93% <100.00%> (+0.26%)` | :arrow_up: |
| [src/transformers/modeling\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19ncHQyLnB5) | `86.82% <100.00%> (+0.14%)` | :arrow_up: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `23.87% <100.00%> (-48.39%)` | :arrow_down: |
| [src/transformers/modeling\_outputs.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vdXRwdXRzLnB5) | `100.00% <100.00%> (ø)` | |
| [src/transformers/modeling\_tf\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9ncHQyLnB5) | `95.01% <100.00%> (ø)` | |
| [src/transformers/modeling\_tf\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9vcGVuYWkucHk=) | `22.58% <100.00%> (-72.26%)` | :arrow_down: |
| ... and [17 more](https://codecov.io/gh/huggingface/transformers/pull/6735/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=footer). Last update [a32d85f...190985c](https://codecov.io/gh/huggingface/transformers/pull/6735?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


> LGTM! Looks like we can now deprecate the `_use_cache` function in the `GenerationMixin`, no?

yes!

**IMPORTANT** This PR does a bigger renaming from "decoder_past_key_values" to "past_key_values" as suggested by @sshleifer. This required changes for `T5`, `TFT5` and `Bart`. For each of the three models it is made sure that `decoder_past_values` can still be used as an input to keep backwards compatibility. 

Would be great if @LysandreJik (and @sgugger, @sshleifer depending on time difference) can review this quickly one last time.

@sshleifer - all EncoderDecoder Slow tests pass. There was one bart test that failed because of Broken Internet connection. I ran this single test again separately and it was fine. PR looks good to me now -> merging.