(self, input, hidden)
| 46 | nn.init.uniform_(self.decoder.weight, -initrange, initrange) |
| 47 | |
| 48 | def forward(self, input, hidden): |
| 49 | emb = self.drop(self.encoder(input)) |
| 50 | output, hidden = self.rnn(emb, hidden) |
| 51 | output = self.drop(output) |
| 52 | decoded = self.decoder(output) |
| 53 | decoded = decoded.view(-1, self.ntoken) |
| 54 | return F.log_softmax(decoded, dim=1), hidden |
| 55 | |
| 56 | def init_hidden(self, bsz): |
| 57 | weight = next(self.parameters()) |
nothing calls this directly
no outgoing calls
no test coverage detected