Merge pull request #23 from rodgzilla/master

Removing unused field of the Transformer class.
This commit is contained in:
Thomas Wolf
2018-07-18 10:35:42 +02:00
committed by GitHub
-1
View File
@@ -158,7 +158,6 @@ class TransformerModel(nn.Module):
self.h = nn.ModuleList([copy.deepcopy(block) for _ in range(cfg.n_layer)])
self.decoder = nn.Linear(cfg.n_embd, vocab, bias=False)
self.decoder.weight = self.embed.weight # Tied weights
self.clf_dropout = nn.Dropout2d(cfg.clf_pdrop) # To reproduce the noise_shape parameter of TF implementation
nn.init.normal_(self.embed.weight, std=0.02)