MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / setUp

Method setUp

tests/networks/utils/test_replace_module.py:35–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33
34class 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()]

Callers

nothing calls this directly

Calls 2

get_num_modulesMethod · 0.95
DenseNet121Class · 0.90

Tested by

no test coverage detected