update the config.is_decoder=True before initialize the decoder
Currently the PreTrainedEncoderDecoder class fails to initialize the "cross-attention layer" since it updates decoder.config.is_decoder = True after decoder initialization.
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/2435?src=pr&el=h1) Report
> Merging [#2435](https://codecov.io/gh/huggingface/transformers/pull/2435?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/9261c7f771fccfa2a2cb78ae544adef2f6eb402b?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `25%`.

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

```diff
@@            Coverage Diff             @@
##           master    #2435      +/-   ##
==========================================
- Coverage   73.24%   73.24%   -0.01%     
==========================================
  Files          87       87              
  Lines       15001    15004       +3     
==========================================
+ Hits        10988    10989       +1     
- Misses       4013     4015       +2
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/2435?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_encoder\_decoder.py](https://codecov.io/gh/huggingface/transformers/pull/2435/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19lbmNvZGVyX2RlY29kZXIucHk=) | `25.58% <25%> (+0.28%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/2435?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/2435?src=pr&el=footer). Last update [9261c7f...b4418d3](https://codecov.io/gh/huggingface/transformers/pull/2435?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
<|||||>Indeed, the cross attention is initialized in `BertLayer` and needs knowledge of the `is_decoder` boolean to ensure it is correctly initialized.

Looks good to me, thanks @zlinao <|||||>> Indeed, the cross attention is initialized in `BertLayer` and needs knowledge of the `is_decoder` boolean to ensure it is correctly initialized.
> 
> Looks good to me, thanks @zlinao

Yes, exactly.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
