Generate: input expansion for any model input
# What does this PR do?

Fixes #21599 

In line with #21603, this PR aims at generalizing `.generate()` for any-to-text models. In particular, it rewrites the function that expands the inputs when `num_beams>1` or `num_return_sequences>1` -- instead of expanding certain keywords within `model_kwargs`, expands any tensor therein. This assumes that all tensors in `model_kwargs` are per-row inputs, but that seems to be the case so far 👍 

The TF case had a more complex change, as we had two functions to expand the inputs (depending on whether we wanted a new dimension or not). This PR also standardizes that distinction.

Slow tests were run for:
- [x] GPT2 (both frameworks)
- [x] T5 (both frameworks)
- [x] BLIP2 (PT)
_The documentation is not available anymore as the PR was closed or merged._