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

Method forward

beginner_source/introyt/autogradyt_tutorial.py:262–266  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

260 self.layer2 = torch.nn.Linear(HIDDEN_SIZE, DIM_OUT)
261
262 def forward(self, x):
263 x = self.layer1(x)
264 x = self.relu(x)
265 x = self.layer2(x)
266 return x
267
268
269some_input = torch.randn(BATCH_SIZE, DIM_IN, requires_grad=False)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected