MCPcopy Create free account
hub / github.com/Sirwenhao/Deep-Learning-Notes / forward

Method forward

CV/Pytorch_classification/ResNet/model.py:140–156  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

138 return nn.Sequential(*layers)
139
140 def forward(self, x):
141 x = self.conv1(x)
142 x = self.bn1(x)
143 x = self.relu(x)
144 x = self.maxpool(x)
145
146 x = self.layer1(x)
147 x = self.layer2(x)
148 x = self.layer3(x)
149 x = self.layer4(x)
150
151 if self.include_top:
152 x = self.avgpool(x)
153 x = torch.flatten(x, 1)
154 x = self.fc(x)
155
156 return x
157
158
159def resnet34(num_classes=1000, include_top=True):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected