(self, x)
| 194 | return nn.Sequential(*layers) |
| 195 | |
| 196 | def _forward_impl(self, x): |
| 197 | # See note [TorchScript super()] |
| 198 | features = [] |
| 199 | x = self.conv1(x) |
| 200 | x = self.bn1(x) |
| 201 | x = self.relu(x) |
| 202 | x = self.maxpool(x) |
| 203 | |
| 204 | x = self.layer1(x) |
| 205 | features.append(x) |
| 206 | |
| 207 | x = self.layer2(x) |
| 208 | features.append(x) |
| 209 | |
| 210 | x = self.layer3(x) |
| 211 | features.append(x) |
| 212 | |
| 213 | x = self.layer4(x) |
| 214 | features.append(x) |
| 215 | |
| 216 | #x = self.avgpool(x) |
| 217 | #x = torch.flatten(x, 1) |
| 218 | #x = self.fc(x) |
| 219 | |
| 220 | return features |
| 221 | |
| 222 | def forward(self, x): |
| 223 | return self._forward_impl(x) |