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
f26b6aff
"vscode:/vscode.git/clone" did not exist on "7d41fe882ccadb141cb7bf648d891e614fd8d1db"
Unverified
Commit
f26b6aff
authored
Jul 10, 2018
by
Alexei Baevski
Committed by
GitHub
Jul 10, 2018
Browse files
assert that vocab size >= adaptive softmax cutoff (#214)
parent
1d79ed9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
fairseq/modules/adaptive_softmax.py
fairseq/modules/adaptive_softmax.py
+3
-0
No files found.
fairseq/modules/adaptive_softmax.py
View file @
f26b6aff
...
...
@@ -22,6 +22,9 @@ class AdaptiveSoftmax(nn.Module):
if
vocab_size
>
cutoff
[
-
1
]:
cutoff
=
cutoff
+
[
vocab_size
]
else
:
assert
vocab_size
==
cutoff
[
-
1
],
'cannot specify cutoff smaller than vocab size'
output_dim
=
cutoff
[
0
]
+
len
(
cutoff
)
-
1
...
...
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