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

Method __init__

beginner_source/introyt/trainingyt.py:138–145  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136# PyTorch models inherit from torch.nn.Module
137class GarmentClassifier(nn.Module):
138 def __init__(self):
139 super().__init__()
140 self.conv1 = nn.Conv2d(1, 6, 5)
141 self.pool = nn.MaxPool2d(2, 2)
142 self.conv2 = nn.Conv2d(6, 16, 5)
143 self.fc1 = nn.Linear(16 * 4 * 4, 120)
144 self.fc2 = nn.Linear(120, 84)
145 self.fc3 = nn.Linear(84, 10)
146
147 def forward(self, x):
148 x = self.pool(F.relu(self.conv1(x)))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected