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

Method __init__

beginner_source/basics/optimization_tutorial.py:51–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

49
50class NeuralNetwork(nn.Module):
51 def __init__(self):
52 super().__init__()
53 self.flatten = nn.Flatten()
54 self.linear_relu_stack = nn.Sequential(
55 nn.Linear(28*28, 512),
56 nn.ReLU(),
57 nn.Linear(512, 512),
58 nn.ReLU(),
59 nn.Linear(512, 10),
60 )
61
62 def forward(self, x):
63 x = self.flatten(x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected