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

Method __init__

beginner_source/basics/quickstart_tutorial.py:95–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93# Define model
94class NeuralNetwork(nn.Module):
95 def __init__(self):
96 super().__init__()
97 self.flatten = nn.Flatten()
98 self.linear_relu_stack = nn.Sequential(
99 nn.Linear(28*28, 512),
100 nn.ReLU(),
101 nn.Linear(512, 512),
102 nn.ReLU(),
103 nn.Linear(512, 10)
104 )
105
106 def forward(self, x):
107 x = self.flatten(x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected