(self)
| 33 | |
| 34 | class TestReplaceModule(unittest.TestCase): |
| 35 | def setUp(self): |
| 36 | self.net = DenseNet121(spatial_dims=2, in_channels=1, out_channels=3) |
| 37 | self.num_relus = self.get_num_modules(torch.nn.ReLU) |
| 38 | self.total = self.get_num_modules() |
| 39 | self.assertGreater(self.num_relus, 0) |
| 40 | |
| 41 | def get_num_modules(self, mod: type[torch.nn.Module] | None = None) -> int: |
| 42 | m = [m for _, m in self.net.named_modules()] |
nothing calls this directly
no test coverage detected