(self, x)
| 534 | self.feature_hooks = FeatureHooks(hooks, self.named_modules()) |
| 535 | |
| 536 | def forward(self, x) -> List[torch.Tensor]: |
| 537 | x = self.conv_stem(x) |
| 538 | x = self.bn1(x) |
| 539 | x = self.act1(x) |
| 540 | if self.feature_hooks is None: |
| 541 | features = [] |
| 542 | if 0 in self._stage_out_idx: |
| 543 | features.append(x) # add stem out |
| 544 | for i, b in enumerate(self.blocks): |
| 545 | x = b(x) |
| 546 | if i + 1 in self._stage_out_idx: |
| 547 | features.append(x) |
| 548 | return features |
| 549 | else: |
| 550 | self.blocks(x) |
| 551 | out = self.feature_hooks.get_output(x.device) |
| 552 | return list(out.values()) |
| 553 | |
| 554 | |
| 555 | def _create_effnet(variant, pretrained=False, **kwargs): |
nothing calls this directly
no test coverage detected