Cleanup bart caching logic
Author: sshleifer
Pull request: yes

Previously, we had a helper function that checked 4 possible cases to determine whether we should:

(a) combine a cached attention mask with a new one.
(b) just use the cached one
(c) just use the new/passed one

This consolidates that logic into 3 branches and deletes the helper func, which was only called once. 


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

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

```diff
@@            Coverage Diff             @@
##           master    #5640      +/-   ##
==========================================
- Coverage   78.11%   77.99%   -0.13%     
==========================================
  Files         146      146              
  Lines       25983    25975       -8     
==========================================
- Hits        20297    20259      -38     
- Misses       5686     5716      +30     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5640?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/5640/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `95.74% <100.00%> (-0.06%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5640/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `64.90% <0.00%> (-33.90%)` | :arrow_down: |
| [src/transformers/tokenization\_xlm\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/5640/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25feGxtX3JvYmVydGEucHk=) | `84.52% <0.00%> (-10.72%)` | :arrow_down: |
| [src/transformers/generation\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5640/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9nZW5lcmF0aW9uX3V0aWxzLnB5) | `97.11% <0.00%> (+0.28%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/5640/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9yb2JlcnRhLnB5) | `93.36% <0.00%> (+49.37%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5640?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/5640?src=pr&el=footer). Last update [7fad617...94aac5d](https://codecov.io/gh/huggingface/transformers/pull/5640?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).