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

Method forward

beginner_source/fgsm_tutorial.py:159–172  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

157 self.fc2 = nn.Linear(128, 10)
158
159 def forward(self, x):
160 x = self.conv1(x)
161 x = F.relu(x)
162 x = self.conv2(x)
163 x = F.relu(x)
164 x = F.max_pool2d(x, 2)
165 x = self.dropout1(x)
166 x = torch.flatten(x, 1)
167 x = self.fc1(x)
168 x = F.relu(x)
169 x = self.dropout2(x)
170 x = self.fc2(x)
171 output = F.log_softmax(x, dim=1)
172 return output
173
174# MNIST Test dataset and dataloader declaration
175test_loader = torch.utils.data.DataLoader(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected