Created
January 17, 2021 21:04
-
-
Save DicksonWu654/2596c1c5218663e211e64ebd2cf32339 to your computer and use it in GitHub Desktop.
Iterators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train_iter = BucketIterator(train_thing, batch_size=bs, sort_key=lambda x: len(x.sequence), | |
device=device, sort=True, sort_within_batch=True) | |
valid_iter = BucketIterator(valid_thing, batch_size=bs, sort_key=lambda x: len(x.sequence), | |
device=device, sort=True, sort_within_batch=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment