Skip to content

Conversation

@ShadyPi
Copy link
Contributor

@ShadyPi ShadyPi commented Apr 26, 2025

What does this PR do?

Correct a wrong tensor shape comment in Mamba modeling.

Fixes # (None, as no issue was explicitly mentioned)

The comment on line 307 of src/transformers/models/mamba/modeling_mamba.py incorrectly states the shape of the tensor scan_output. It should be [batch, intermediade_size, seq_len] instead of [batch, seq_len, intermediade_size].

scan_outputs is a list of seq_len [batch, intermediade_size] tensors. When stack them on dimension -1, the correct shape should be [batch, intermediade_size, seq_len].

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? 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, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests? (Not applicable for a comment correction)

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.

@ArthurZucker @alxndrTL

@github-actions github-actions bot marked this pull request as draft April 26, 2025 02:58
@github-actions
Copy link
Contributor

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.

@ShadyPi ShadyPi marked this pull request as ready for review April 26, 2025 03:02
@github-actions github-actions bot requested a review from ArthurZucker April 26, 2025 03:03
Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is correct! Going to fix the spelling of 'intermediate' too before merging.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Rocketknight1 Rocketknight1 merged commit 97e57b2 into huggingface:main Apr 28, 2025
10 checks passed
sushmanthreddy pushed a commit to sushmanthreddy/transformers that referenced this pull request Apr 28, 2025
* Fix: Correct tensor shape comment in Mamba modeling

* Update src/transformers/models/mamba/modeling_mamba.py

* Update src/transformers/models/mamba/modeling_mamba.py

---------

Co-authored-by: ShadyPi <[email protected]>
Co-authored-by: Matt <[email protected]>
@ShadyPi ShadyPi deleted the fix-mamba-comment-shape branch April 28, 2025 16:06
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
* Fix: Correct tensor shape comment in Mamba modeling

* Update src/transformers/models/mamba/modeling_mamba.py

* Update src/transformers/models/mamba/modeling_mamba.py

---------

Co-authored-by: ShadyPi <[email protected]>
Co-authored-by: Matt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants