add type hints for gpt2 model classes (PyTorch)
# What does this PR do?

1. This PR adds type hints for GPT2 as mentioned in #16059 (following docs and other PRs for GPT-like model classes).

Notes:
- I've specified tensor subtypes where I could, e.g. `Optional[torch.LongTensor]`, `Optional[torch.FloatTensor]` as opposed to `Optional[torch.Tensor]` (assuming that's desired)
- I was not entirely sure about `encoder_hidden_states`, as those don't seem to be documented yet (Tuple?, assumed it's `torch.FloatTensor`)
- I was not able to run `pytest` yet due to local (Flask version) conflicts
- I was not able to run `make fixup` locally

(first time contributing in Python, so happy to work on and learn setting up tests)

## Who can review?

@Rocketknight1 



The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_16240). All of your documentation changes will be reflected on that endpoint.<|||||>@KristijanArmeni thanks for this PR! I think the types you chose look good. Running `make fixup` can be tricky, though - it depends on having a working `transformers` dev environment. You need to follow the instructions here, but if you're running on Windows you might find that this is impossible: https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md

If you can't get `make fixup` working, feel free to ping me and I'll do it! Make sure you've enabled contributions from maintainers on your PR.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.