"vscode:/vscode.git/clone" did not exist on "7d41fe882ccadb141cb7bf648d891e614fd8d1db"
Unverified Commit f26b6aff authored by Alexei Baevski's avatar Alexei Baevski Committed by GitHub
Browse files

assert that vocab size >= adaptive softmax cutoff (#214)

parent 1d79ed9b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment