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
871be389
Commit
871be389
authored
Apr 04, 2018
by
Myle Ott
Browse files
Faster fconv generation
parent
0e8414f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
fairseq/models/fconv.py
fairseq/models/fconv.py
+4
-1
No files found.
fairseq/models/fconv.py
View file @
871be389
...
@@ -279,8 +279,11 @@ class FConvDecoder(FairseqIncrementalDecoder):
...
@@ -279,8 +279,11 @@ class FConvDecoder(FairseqIncrementalDecoder):
encoder_a
,
encoder_b
=
self
.
_split_encoder_out
(
encoder_out
,
incremental_state
)
encoder_a
,
encoder_b
=
self
.
_split_encoder_out
(
encoder_out
,
incremental_state
)
# embed tokens and combine with positional embeddings
# embed tokens and combine with positional embeddings
pos_embed
=
self
.
embed_positions
(
prev_output_tokens
,
incremental_state
)
if
incremental_state
is
not
None
:
prev_output_tokens
=
prev_output_tokens
[:,
-
1
:]
x
=
self
.
_embed_tokens
(
prev_output_tokens
,
incremental_state
)
x
=
self
.
_embed_tokens
(
prev_output_tokens
,
incremental_state
)
x
+=
self
.
embed_positions
(
prev_output_tokens
,
incremental_state
)
x
+=
pos_embed
x
=
F
.
dropout
(
x
,
p
=
self
.
dropout
,
training
=
self
.
training
)
x
=
F
.
dropout
(
x
,
p
=
self
.
dropout
,
training
=
self
.
training
)
target_embedding
=
x
target_embedding
=
x
...
...
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