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

Method forward

beginner_source/introyt/introyt1_tutorial.py:188–197  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

186 self.fc3 = nn.Linear(84, 10)
187
188 def forward(self, x):
189 # Max pooling over a (2, 2) window
190 x = F.max_pool2d(F.relu(self.conv1(x)), (2, 2))
191 # If the size is a square you can only specify a single number
192 x = F.max_pool2d(F.relu(self.conv2(x)), 2)
193 x = x.view(-1, self.num_flat_features(x))
194 x = F.relu(self.fc1(x))
195 x = F.relu(self.fc2(x))
196 x = self.fc3(x)
197 return x
198
199 def num_flat_features(self, x):
200 size = x.size()[1:] # all dimensions except the batch dimension

Callers

nothing calls this directly

Calls 1

num_flat_featuresMethod · 0.95

Tested by

no test coverage detected