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

Padding in DataLoader's collate_fn or in Dataset object? #4

Open
Tracked by #7
fangzhouli opened this issue Jul 15, 2022 · 0 comments
Open
Tracked by #7

Padding in DataLoader's collate_fn or in Dataset object? #4

fangzhouli opened this issue Jul 15, 2022 · 0 comments

Comments

@fangzhouli
Copy link
Contributor

Collate_fn is batchwise, meaning the padding is based on the max_seq_len in that batch.
Padding in Dataset means that all inputs are padded based on the global max_seq_len.

Collate_fn reduced the total amount of input size for sure, but it is executed for each batch meaning there is additional overhead.

@fangzhouli fangzhouli added the enhancement New feature or request label Jul 15, 2022
@fangzhouli fangzhouli removed the enhancement New feature or request label Jul 15, 2022
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

No branches or pull requests

1 participant