Skip to content

Remove unused batch_shape variable in _get_states_from_cache#906

Open
Chessing234 wants to merge 1 commit intostate-spaces:mainfrom
Chessing234:fix/remove-unused-batch-shape-variable
Open

Remove unused batch_shape variable in _get_states_from_cache#906
Chessing234 wants to merge 1 commit intostate-spaces:mainfrom
Chessing234:fix/remove-unused-batch-shape-variable

Conversation

@Chessing234
Copy link
Copy Markdown
Contributor

Summary

  • Removes the unused batch_shape variable from Mamba._get_states_from_cache in mamba_simple.py and Mamba2._get_states_from_cache in mamba2.py
  • The variable was assigned (batch_size,) but never referenced, making it dead code

Details

Both _get_states_from_cache methods contained:

batch_shape = (batch_size,)

This line has no effect since batch_shape is not used anywhere in the function body. Removing it improves code clarity.

Test plan

  • No behavioral change; this is a dead code removal
  • Existing tests should pass unchanged

The `batch_shape` variable was assigned but never referenced in
`Mamba._get_states_from_cache` and `Mamba2._get_states_from_cache`,
making it dead code. This removes it from both modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant