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
2d3161da
Commit
2d3161da
authored
Sep 24, 2017
by
Sergey Edunov
Browse files
Issue #2, Checking size attribute of dst when dst is None
parent
a6155337
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairseq/data.py
fairseq/data.py
+1
-1
No files found.
fairseq/data.py
View file @
2d3161da
...
...
@@ -216,7 +216,7 @@ def batches_by_size(src, batch_size=None, max_tokens=None, dst=None, max_positio
# - 2 here stems from make_positions() where we offset positions
# by padding_value + 1
if
src
.
sizes
[
idx
]
<
2
or
\
(
dst
is
not
None
and
dst
.
sizes
[
idx
]
<
2
)
or
\
(
False
if
dst
is
None
else
dst
.
sizes
[
idx
]
<
2
)
or
\
sizes
[
idx
]
>
max_positions
-
2
:
raise
Exception
(
"Unable to handle input id {} of "
"size {} / {}."
.
format
(
idx
,
src
.
sizes
[
idx
],
dst
.
sizes
[
idx
]))
...
...
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