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
cc7705d3
Commit
cc7705d3
authored
Dec 07, 2017
by
Myle Ott
Browse files
Fix generation bug with large beam sizes (>50)
parent
9430544a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairseq/sequence_generator.py
fairseq/sequence_generator.py
+1
-1
No files found.
fairseq/sequence_generator.py
View file @
cc7705d3
...
...
@@ -269,7 +269,7 @@ class SequenceGenerator(object):
# and values < cand_size indicate candidate active hypos.
# After, the min values per row are the top candidate active hypos
active_mask
=
buffer
(
'active_mask'
)
torch
.
add
(
(
eos_mask
*
cand_size
)
.
type_as
(
cand_offsets
),
cand_offsets
[:
eos_mask
.
size
(
1
)],
torch
.
add
(
eos_mask
.
type_as
(
cand_offsets
)
*
cand_size
,
cand_offsets
[:
eos_mask
.
size
(
1
)],
out
=
active_mask
)
# get the top beam_size active hypotheses, which are just the hypos
...
...
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