(self, bsz)
| 54 | return F.log_softmax(decoded, dim=1), hidden |
| 55 | |
| 56 | def init_hidden(self, bsz): |
| 57 | weight = next(self.parameters()) |
| 58 | if self.rnn_type == 'LSTM': |
| 59 | return (weight.new_zeros(self.nlayers, bsz, self.nhid), |
| 60 | weight.new_zeros(self.nlayers, bsz, self.nhid)) |
| 61 | else: |
| 62 | return weight.new_zeros(self.nlayers, bsz, self.nhid) |
| 63 | |
| 64 | # Temporarily leave PositionalEncoding module here. Will be moved somewhere else. |
| 65 | class PositionalEncoding(nn.Module): |
no outgoing calls
no test coverage detected