Fix for non-contiguous label tensors in VisonEncoderDecoder
Author: morganmcg1
Pull request: yes

# What does this PR do?
Fixes loss calculation error due to non-contiguous label tensors, replaced `labels.view(-1)` with `labels.reshape(-1)`

When passing a slice of a labels tensor to the `labels` argument the following error would get triggered:

`RuntimeError: view size is not compatible with input tensor's size and stride`


```
 outputs = model(pixel_values,
                       decoder_input_ids=decoder_input_ids[:, :-1],
                       labels=labels[:, 1:])
```


Using `reshape` instead of `view` means that if `view` is not possible, the input call fall back to using `resahpe`, as per the [PyTorch `reshape` documentation here](https://pytorch.org/docs/stable/generated/torch.reshape.html#torch.reshape)

From the docs:
> When possible, the returned tensor will be a view of input. Otherwise, it will be a copy


## 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#start-contributing-pull-requests),
      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).
- [ ] Did you write any new necessary tests?


## 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.

<!-- 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:

- vision models: @amyeroberts and @NielsRogge

 -->

@amyeroberts @NielsRogge


Comments:
_The documentation is not available anymore as the PR was closed or merged._

@morganmcg1 - thanks for the fix! 

Change looks good to me, just two small things: 
* Could you give more details about the error e.g. a code snippet? This will help with documentation for future us to track and resolve any similar issues. 
* I can see the `check_code_quality` checks fail. I'm not sure why it's hitting an issue with flax electra, as this PR doesn't touch it. Could you add the latest changes from main and run `make fixup` in the top level of your local `transformers`? If it persists I'll do some more digging. 

@amyeroberts The quality issue is fixed on main, the PR just needs a quick rebase :-) 

hey @amyeroberts , sure! rebased and updated the description, let me know if you need any more details 

Awesome fix, @morganmcg1 ! Thank you, @sgugger for the quick review and merge!