MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

distributed/rpc/rnn/rnn.py:62–67  ·  view source on GitHub ↗
(self, ntoken, nhid, dropout)

Source from the content-addressed store, hash-verified

60 Decoding layers of the RNNModel
61 """
62 def __init__(self, ntoken, nhid, dropout):
63 super(Decoder, self).__init__()
64 self.drop = nn.Dropout(dropout)
65 self.decoder = nn.Linear(nhid, ntoken)
66 nn.init.zeros_(self.decoder.bias)
67 nn.init.uniform_(self.decoder.weight, -0.1, 0.1)
68
69 def forward(self, output):
70 return self.decoder(self.drop(output))

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected