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

Method forward

distributed/rpc/rnn/rnn.py:51–55  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

49 nn.init.uniform_(self.encoder.weight, -0.1, 0.1)
50
51 def forward(self, input):
52 if torch.accelerator.is_available():
53 device = torch.accelerator.current_accelerator()
54 input = input.to(device)
55 return self.drop(self.encoder(input)).cpu()
56
57
58class Decoder(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected