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
a4f86a89
Commit
a4f86a89
authored
Dec 22, 2017
by
Myle Ott
Browse files
Better error message for --decoder-attention
parent
a09fe803
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
fairseq/models/fconv.py
fairseq/models/fconv.py
+3
-0
No files found.
fairseq/models/fconv.py
View file @
a4f86a89
...
...
@@ -163,6 +163,9 @@ class FConvDecoder(FairseqIncrementalDecoder):
if
isinstance
(
attention
,
bool
):
# expand True into [True, True, ...] and do the same with False
attention
=
[
attention
]
*
len
(
convolutions
)
if
not
isinstance
(
attention
,
list
)
or
len
(
attention
)
!=
len
(
convolutions
):
raise
ValueError
(
'Attention is expected to be a list of booleans of '
'length equal to the number of layers.'
)
num_embeddings
=
len
(
dictionary
)
padding_idx
=
dictionary
.
pad
()
...
...
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