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
74efc214
Unverified
Commit
74efc214
authored
Jun 25, 2018
by
Myle Ott
Committed by
GitHub
Jun 25, 2018
Browse files
Fix attention order in unit tests (fixes #195) (#197)
parent
bd4db8fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/utils.py
tests/utils.py
+1
-1
No files found.
tests/utils.py
View file @
74efc214
...
@@ -154,7 +154,7 @@ class TestIncrementalDecoder(FairseqIncrementalDecoder):
...
@@ -154,7 +154,7 @@ class TestIncrementalDecoder(FairseqIncrementalDecoder):
probs
[:,
i
,
self
.
dictionary
.
eos
()]
=
1.0
probs
[:,
i
,
self
.
dictionary
.
eos
()]
=
1.0
# random attention
# random attention
attn
=
torch
.
rand
(
bbsz
,
src
_len
,
tgt
_len
)
attn
=
torch
.
rand
(
bbsz
,
tgt
_len
,
src
_len
)
return
Variable
(
probs
),
Variable
(
attn
)
return
Variable
(
probs
),
Variable
(
attn
)
...
...
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