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

Method forward

beginner_source/introyt/modelsyt_tutorial.py:163–172  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

161 self.fc3 = torch.nn.Linear(84, 10)
162
163 def forward(self, x):
164 # Max pooling over a (2, 2) window
165 x = F.max_pool2d(F.relu(self.conv1(x)), (2, 2))
166 # If the size is a square you can only specify a single number
167 x = F.max_pool2d(F.relu(self.conv2(x)), 2)
168 x = x.view(-1, self.num_flat_features(x))
169 x = F.relu(self.fc1(x))
170 x = F.relu(self.fc2(x))
171 x = self.fc3(x)
172 return x
173
174 def num_flat_features(self, x):
175 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