add return_tensor parameter for feature extraction
Author: ajsanjoaquin
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixes #10016


## Before submitting
- [ x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [✔️](https://emojipedia.org/check-mark/#:~:text=See%20also%3A%20%E2%9C%85%20Check%20Mark,to%20Emoji%201.0%20in%202015.) 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).
- [x ] Did you write any new necessary tests?

Addresses [stale issue #10016](https://github.com/huggingface/transformers/issues/10016). Please review @LysandreJik and @Narsil. Thanks.

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

Feedback has been addressed :)

Not sure what's happening with CircleCI... 

Last suggestion was addressed, but CircleCI Pipeline still seems broken...

@ajsanjoaquin do you have circleCI set up on your account/branch ? I remember people sometimes having issues because of this.

Otherwise, could you try to rebase on `main`? 

Pinging @LysandreJik that might know more.

The CircleCI pipeline seems to be working again!

For quality can you try

```
pip install transformers[dev]
make fixup
```

?

@Narsil when running `make fixup`, I get the following error. Perhaps it's possible to replicate on your end?

```
-n was unexpected at this time.
make: *** [Makefile:10: modified_only_fixup] Error 255
```

> -n was unexpected at this time.

What OS/Linux flavor you're running on ? Shell maybe ? 
Seems like `test -n` is not supported in your environment.

I'm in a temporary dev environment, so I'm using Windows 😅. I'll use WSL next time. So the formatting error was simply a result of missing newline before importing torch and tf?

> I'm in a temporary dev environment, so I'm using Windows sweat_smile. I'll use WSL next time. So the formatting error was simply a result of missing newline before importing torch and tf?

We use `black` and `isort` to normalize as much as possible the code, so yes import order is automatically done for you.

@Narsil can this PR be merged soon when it passes all tests? I just resolved a conflict made by a different commit on the same file.

@ajsanjoaquin 
It seems there is an issue with your CircleCI permissions, the tests won't run.
Could you try refreshing your permissions as shown [here](https://support.circleci.com/hc/en-us/articles/360048210711-How-to-Refresh-User-Permissions-) ?

@Narsil the `check_repository_consistency` test is failing because of a .md file unrelated to my PR. Do I have to address this in this PR?

`check_code_quality` is again failing and I can't use `make fixup`. I request you re-fix the latter. 

I hope this can be passed soon before another PR like #19382 modifies the exact code I was working on...

This PR was based on an old fork of the repo and as such, the pipeline tests were not run. They do not pass, so I will revert the commit. Could you open a new PR with fixed tests?

I am confused, should we re-open a PR or start from here https://github.com/huggingface/transformers/pull/19679

(I tried re-opening a PR but it resulted in a no-op...)