MCPcopy Create free account
hub / github.com/pytorch/tutorials / forward

Method forward

intermediate_source/char_rnn_generation_tutorial.py:168–176  ·  view source on GitHub ↗
(self, category, input, hidden)

Source from the content-addressed store, hash-verified

166 self.softmax = nn.LogSoftmax(dim=1)
167
168 def forward(self, category, input, hidden):
169 input_combined = torch.cat((category, input, hidden), 1)
170 hidden = self.i2h(input_combined)
171 output = self.i2o(input_combined)
172 output_combined = torch.cat((hidden, output), 1)
173 output = self.o2o(output_combined)
174 output = self.dropout(output)
175 output = self.softmax(output)
176 return output, hidden
177
178 def initHidden(self):
179 return torch.zeros(1, self.hidden_size)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected