A potential bug here found in `BeamSearchScorer.process`
### System Info

System doesn't matter.

### Who can help?

@gante 

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

I am new to the transformer and reading the source code of the beam search in `src/transformers/generation/beam_search.py`. And I have a question about the code here: https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L290

I noticed in PR #21993, the variable `cur` is increased by one before checking if beam hyp is done, but **this variable is increased in a loop**. In other words, this variable would be increased for each sample in this batch. I wonder if there is any particular reason for that.

### Expected behavior

```python
    def process(
        self,
        input_ids: torch.LongTensor,
        next_scores: torch.FloatTensor,
        next_tokens: torch.LongTensor,
        next_indices: torch.LongTensor,
        pad_token_id: Optional[int] = None,
        eos_token_id: Optional[Union[int, List[int]]] = None,
        beam_indices: Optional[torch.LongTensor] = None,
    ) -> Tuple[torch.Tensor]:
        cur_len = input_ids.shape[-1] + 1  # the one should be add up here, instead of in the loop.
        # some code here.
        for batch_idx, beam_hyp in enumerate(self._beam_hyps):
            # some code here.
            self._done[batch_idx] = self._done[batch_idx] or beam_hyp.is_done(
                next_scores[batch_idx].max().item(), cur_len
            )
        # some code here.
```
Hey @ZachVec -- I believe you are correct, the implementation is incorrect for batch size > 1. I'll open a PR to fix it :)<|||||>Should be fixed now 🤗 