🚨🚨🚨 Fix forward of Dinov2ForImageClassification for models with registers
Author: psandovalsegura
Pull request: yes

# What does this PR do?

Redefined the forward of `Dinov2WithRegistersForImageClassification` so that we properly access the patch tokens and skip over registers. 

Fixes #37817

Additional details:

- Change was made to `src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py` then I ran `python utils/modular_model_converter.py --files_to_parse src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py`.
- Using a breakpoint at `Dinov2WithRegistersForImageClassification.forward` I confirmed that given the following input:
```
import torch
from transformers import AutoModelForImageClassification
p = torch.randn(1, 3, 224, 224)
m = AutoModelForImageClassification.from_pretrained('facebook/dinov2-with-registers-small-imagenet1k-1-layer')
o = m(p)
```
produces the expected shapes for the following tensors:
```
sequence_output.shape=torch.Size([1, 261, 384])                                                                                     
cls_token.shape=torch.Size([1, 384])                                                                                                
patch_tokens.shape=torch.Size([1, 256, 384]) 
```
whereas previously, `patch_tokens.shape` would be `torch.Size([1, 260, 384])` which is incorrect. We need to skip the 4 register tokens.

## Who can review?

@NielsRogge @qubvel 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier

Library:

- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface and @SunMarc
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the `Ready for review` button (at the bottom of the PR page). This will assign reviewers and trigger CI.

There's no need to update models on the hub because this change only affects the forward pass. @NielsRogge confirmed this in discussion of https://github.com/huggingface/transformers/issues/37817

run-slow: dinov2_with_registers

This comment contains run-slow, running the specified jobs: This comment contains run-slow, running the specified jobs:

models: ['models/dinov2_with_registers']
quantizations: [] ...

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

cc @Cyrilvallez to confirm breaking change merge. slow CI failures are unrelated