MCPcopy Create free account
hub / github.com/apache/singa / forward

Method forward

examples/rnn/char_rnn.py:65–71  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

63 self.reset_states(inputs[0].device)
64
65 def forward(self, inputs):
66 x, hx, cx = self.rnn(inputs, (self.hx, self.cx))
67 self.hx.copy_data(hx)
68 self.cx.copy_data(cx)
69 x = self.cat(x)
70 x = self.reshape1(x, (-1, self.hidden_size))
71 return self.dense(x)
72
73 def train_one_batch(self, x, y):
74 out = self.forward(x)

Callers 1

train_one_batchMethod · 0.95

Calls 1

copy_dataMethod · 0.45

Tested by

no test coverage detected