Improved type hinting for all attention parameters
Author: nakranivaibhav
Pull request: yes

# What does this PR do?
The type hinting for all attention parameters has been changed to 'Optional[Tuple[torch.FloatTensor,...]] = None' to reflect a tuple of arbitrary size.

Fixes #28345

- [ ] 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?
- [x] 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?
@ArthurZucker @Rocketknight1 


Comments:
I had no space between the "," and "..." That failed the formatting. 
Yeah @Rocketknight1 makes sense doing that to hidden states too, since it is the same as attentions, depends on num of layers. I can do that too

Looks good to me, pinging @ArthurZucker for core maintainer review!

@amyeroberts I will look into it. I can do that too. Happy to help :)

@nakranivaibhav Amazing 🤗 Let me know when it's ready for another review! 

@amyeroberts Alright 🚀

@amyeroberts can you approve recent changes. Chnaged 15 files. 
I also noticed there is no equivalent of CLIPTextModelOutput in the modeling_tf_clip.py script. Is it intended or that part is missed?

@nakranivaibhav Awesome work! For CLIPTextModelOutput I believe that's just an oversight. Feel free to add as part of this PR! 

The current diff is quite large and contains changes recently merged into `main`. From the commit history it looks like you've rebase and pushed without forcing. To make sure the branch contains just your commits and is up-to-date with the development branch - working on this branch: 
* `git fetch upstream main`
* `git rebase upstream/main`
* `git push -f`

@amyeroberts Yeah I did mess up something. Sorry, I am new to git. I will push the changes again.
I'll also add CLIPTextModelOutput in modeling_tf_clip.py


@nakranivaibhav No worries - we've all done it at least once! Let me know when those changes are pushed and I should review

@amyeroberts I have pushed a fresh commit. You can review it now.

@nakranivaibhav There's currently a whole directory `myenv` which is part of this PR. You'll need to remove these: `git rm -r myenv`

@amyeroberts I do have myvenv in the .gitignore file. For some reason, it got pushed too. I did git rm -r myvenv. Is that it or do i have to push a fresh commit?


`git rm` is the complement to `git add`. In the same way, it's just a step which moves the files to staging - they still need to be applied with a commit and push to the remote. You can check this yourself by looking at the [files changed](https://github.com/huggingface/transformers/pull/28479/files) tab for this PR (you can see `myenv` is still there). 

I would recommend reviewing the diff in the file changes for a PR to see all the changes and make any modifications if needed before asking for review. 

@amyeroberts I have removed the myvenv directory. Do I need to update the .gitignore file as well and make a new generic venv already listed in the .gitignore file so that it does not get pushed and the .gitignore file remains unchanged?

P.S: Thank you for bearing this. I don't know my way around git and you are helping me a lot.

@amyeroberts Yes I have checked there is no confidential information in that commit. You can go ahead and merge.

@nakranivaibhav Thanks for confirming and all the work improving our types! 

@amyeroberts Always happy to help. On to the next one 🚀