Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
45082e48
Commit
45082e48
authored
Aug 02, 2018
by
alexeib
Committed by
Myle Ott
Sep 03, 2018
Browse files
make batching faster for monolingual dataset
parent
0b5166db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
fairseq/data/monolingual_dataset.py
fairseq/data/monolingual_dataset.py
+1
-2
No files found.
fairseq/data/monolingual_dataset.py
View file @
45082e48
...
@@ -63,8 +63,7 @@ class MonolingualDataset(FairseqDataset):
...
@@ -63,8 +63,7 @@ class MonolingualDataset(FairseqDataset):
def
num_tokens
(
self
,
index
):
def
num_tokens
(
self
,
index
):
"""Return an example's length (number of tokens), used for batching."""
"""Return an example's length (number of tokens), used for batching."""
source
,
target
=
self
.
dataset
[
index
]
return
self
.
sizes
[
index
]
return
len
(
source
)
def
ordered_indices
(
self
):
def
ordered_indices
(
self
):
"""Ordered indices for batching."""
"""Ordered indices for batching."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment