Loosen output shape restrictions on GPT-style models
# What does this PR do?

This PR loosens checks in the model classes of a couple of GPT-style models that enforce the output shape of the model to be identical to the input shape. This aligns the changed model classes to most other model classes which don't enforce the shapes to be identical.

I might not be aware of some legitimate reasons why these restrictions are in place specifically for these models. Please let me know if there are any and I'll close this PR :) 

## Motivation

We're building a library on top of Transformers that leverages various model implementations. Among others, some features in our library will result in the batch size to change dynamically during one model forward pass. While implementing these features, we didn't find this to be an issue for most model classes as they don't require the input and output shapes to be identical. However, some GPT-style models do enforce this. To avoid copying and keeping in sync the full model classes, it would be super helpful to us if these restrictions could also be loosened for GPT models.

## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

- text models: @ArthurZucker and @younesbelkada

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25188). All of your documentation changes will be reflected on that endpoint.<|||||>In principle, it should be OK to loosen this restriction as it doesn't introduce any breaking changes. However, it is making the code more likely to have a silent bug. Let's get a second opinion from @sgugger

With regard to the changes, I'd prefer that the instead of slicing, `input_shape[1:]`, we name each of the dimensions explicitly so it's clearer what `output_shape` is e.g. `output_shape = (-1, sequence_length, hidden_size)`. 