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

Method __init__

beginner_source/basics/buildmodel_tutorial.py:49–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected