Skip to content

fix: correct torch.torch.int32 typo to torch.int32 - #1258

Closed
Mr-Neutr0n wants to merge 1 commit into
OpenGVLab:mainfrom
Mr-Neutr0n:fix/torch-int32-typo
Closed

fix: correct torch.torch.int32 typo to torch.int32#1258
Mr-Neutr0n wants to merge 1 commit into
OpenGVLab:mainfrom
Mr-Neutr0n:fix/torch-int32-typo

Conversation

@Mr-Neutr0n

Copy link
Copy Markdown

Summary

  • Fix typo torch.torch.int32 to torch.int32 in internvl_chat/internvl/model/internlm2/modeling_internlm2.py (line 87)

Details

In the _get_unpad_data function, the dtype argument to torch.cumsum is specified as torch.torch.int32. This works at runtime by accident because torch.torch resolves circularly back to the torch module itself (i.e., torch.torch is torch evaluates to True), so torch.torch.int32 ends up being the same object as torch.int32.

However, this is clearly a typo and will cause failures under static type checkers (e.g., mypy, pyright) since torch.torch is not part of the public API. This PR corrects it to torch.int32.

Note that line 84 in the same function already uses the correct torch.int32:

seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)

@Mr-Neutr0n

Copy link
Copy Markdown
Author

Closing this one to tidy up my open pull requests.

It's been open around five months with no review activity, and I'd rather withdraw it than leave it sitting in your queue. Nothing needed from you, and no hard feelings at all.

If the fix is still wanted, this can be reopened, or I'm happy to redo it properly against current main. Apologies for the noise.

@Mr-Neutr0n Mr-Neutr0n closed this Jul 28, 2026
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