fix gradient checkpoint tests in encoder-decoder
# What does this PR do?

Fix the test `test_training_gradient_checkpointing` in `test_modeling_encoder_decoder.py`.

The current error is
```python
RuntimeError: Expected all tensors to be on the same device, but found at least two device
```
_The documentation is not available anymore as the PR was closed or merged._