BERT decoder: Fix failure with the default attention mask.
Author: osyvokon
Pull request: yes

PyTorch < 1.3 requires multiplication operands to be of the same type. This was violated when using default attention mask (i.e.., `attention_mask=None` in arguments) given BERT in the decoder mode.

In particular, this was breaking `Model2Mode`l and made a tutorial from quickstart.md failing.

A test is included, but here is a minimal snippet to reproduce:

```python
import torch
from transformers import BertModel
model = BertModel.from_pretrained("bert-base-uncased", is_decoder=True)
inputs = torch.LongTensor([[1, 2, 3]])
model(inputs)    # no `attention_mask` provided
```

On PyTorch 1.2 or older this was failing with 
```
Traceback (most recent call last):
...
  File "/home/oleksiy.syvokon/transformers/src/transformers/modeling_bert.py", line 735, in forward
    extended_attention_mask = causal_mask[:, None, :, :] * attention_mask[:, None, None, :]
RuntimeError: expected device cpu and dtype Float but got device cpu and dtype Long
```

Comments:
Thanks for the feedback! That's a valid concern. I made config handling consistent, at least for the BERT tests. But if you decide that it's too much change for such a trivial fix, I can revert the changes in tests.

(Seems like CircleCI tests failure is transient and unrelated to the PR)

That's one way of solving the issue, but now it makes the BERT tests incoherent with the rest of the tests, which all use tuples instead of dictionaries. For this PR, I believe the most simple would be to revert to using tuples and use this tuple in `test_bert_model_as_decoder_with_default_input_mask`. What do you think?

# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/2756?src=pr&el=h1) Report
> Merging [#2756](https://codecov.io/gh/huggingface/transformers/pull/2756?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/1f5db9a13c8932e02e6e7d599a16dc262b1570bf?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master    #2756   +/-   ##
=======================================
  Coverage   75.02%   75.02%           
=======================================
  Files          93       93           
  Lines       15275    15275           
=======================================
  Hits        11460    11460           
  Misses       3815     3815
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/2756?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_bert.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iZXJ0LnB5) | `87.9% <ø> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_camembert.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9jYW1lbWJlcnQucHk=) | `100% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_xlm\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl94bG1fcm9iZXJ0YS5weQ==) | `100% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9yb2JlcnRhLnB5) | `100% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_ctrl.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9jdHJsLnB5) | `97.82% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_t5.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl90NS5weQ==) | `96.54% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_bert.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9iZXJ0LnB5) | `96.05% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9vcGVuYWkucHk=) | `95.84% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `95.11% <0%> (ø)` | :arrow_up: |
| [src/transformers/modeling\_tf\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9ncHQyLnB5) | `94.66% <0%> (ø)` | :arrow_up: |
| ... and [19 more](https://codecov.io/gh/huggingface/transformers/pull/2756/diff?src=pr&el=tree-more) | |

------

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


@LysandreJik, I agree. Reverted unnecessary changes in tests.

Great, thanks @asivokon !!