Add strategy to store results in evaluation loop
Author: qubvel
Pull request: yes

# What does this PR do?

In certain scenarios, the evaluation loop concatenates tensors, making them unusable. For instance, in the object detection evaluation loop, the label structure is as follows:

```python
batch_1 = [
    {
        'size': tensor([ 771, 1333]),
        'image_id': tensor([1592]),
        'class_labels': tensor([0]),
        'boxes': tensor([[0.2268, 0.6586, 0.1567, 0.1480]]),
        'area': tensor([23827.1230]),
        'iscrowd': tensor([0]),
        'orig_size': tensor([561, 970])
    },
    ...
]
batch_2 = [
    {
        'size': tensor([1333,  763]),
        'image_id': tensor([44]),
        'class_labels': tensor([0, 1]),
        'boxes': tensor([[0.4216, 0.4584, 0.3794, 0.1979], [0.4216, 0.4584, 0.3794, 0.1979]]),
        'area': tensor([76371.3984, 76371.3984]),
        'iscrowd': tensor([0, 0]),
        'orig_size': tensor([926, 530])
    },
    ...
]
```
Each dictionary represents one image, with all its bounding boxes.

The problem arises when the trainer runs the evaluation loop and must concatenate each result. It concatenates the labels of every evaluation batch, using the internal nested_concat.

The result of the nested concatenation of these labels will look like this:
```python
[
    {
        'size': tensor([ 771, 1333, 1333,  763]),
        'image_id': tensor([1592, 44]),
        'class_labels': tensor([0, 0, 1]),
        'boxes': tensor([[0.2268, 0.6586, 0.1567, 0.1480], [0.4216, 0.4584, 0.3794, 0.1979], [0.4216, 0.4584, 0.3794, 0.1979]]),
        'area': tensor([23827.1230, 76371.3984, 76371.3984]),
        'iscrowd': tensor([0, 0]),
        'orig_size': tensor([561, 970, 926, 530])
    },
    ...
]
```
This results in the concatenation of all boxes, making it impossible to distinguish which boxes belong to each image.

This PR introduces an additional strategy for storing batches. By setting `eval_do_concat_batches=False` in the training arguments, batches will be stored as separate list items rather than being concatenated.

Fixes # (issue)
https://github.com/huggingface/transformers/issues/25939
https://discuss.huggingface.co/t/possible-fix-for-trainer-evaluation-with-object-detection/72307
https://discuss.huggingface.co/t/add-metrics-to-object-detection-example/31213/12

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review?

@muellerzr and @pacman100
@amyeroberts

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_30267). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

All tests are green, all comments addressed 🙂