Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop padding in collate #343

Merged
merged 5 commits into from
Feb 11, 2024
Merged

Crop padding in collate #343

merged 5 commits into from
Feb 11, 2024

Conversation

liamhazan
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@mosheraboh mosheraboh left a comment

Choose a reason for hiding this comment

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

Looks good!
One comment inline.

input_ids_list: List[torch.Tensor], pad_token_id: int
) -> torch.Tensor:
"""
Crop padding of a batch of input_ids tensors to the minimum length possible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you specify here what is the expected/ supported dim of an element in input_ids? I assume 1d tensors only.

@liamhazan liamhazan merged commit 1b50c1d into master Feb 11, 2024
5 checks passed
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.

2 participants