MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / _check_branches

Method _check_branches

segmentation/backbones/hrnet.py:50–66  ·  view source on GitHub ↗

Check branches configuration.

(self, num_branches, num_blocks, in_channels,
                        num_channels)

Source from the content-addressed store, hash-verified

48 self.relu = nn.ReLU(inplace=False)
49
50 def _check_branches(self, num_branches, num_blocks, in_channels,
51 num_channels):
52 """Check branches configuration."""
53 if num_branches != len(num_blocks):
54 error_msg = f'NUM_BRANCHES({num_branches}) <> NUM_BLOCKS(' \
55 f'{len(num_blocks)})'
56 raise ValueError(error_msg)
57
58 if num_branches != len(num_channels):
59 error_msg = f'NUM_BRANCHES({num_branches}) <> NUM_CHANNELS(' \
60 f'{len(num_channels)})'
61 raise ValueError(error_msg)
62
63 if num_branches != len(in_channels):
64 error_msg = f'NUM_BRANCHES({num_branches}) <> NUM_INCHANNELS(' \
65 f'{len(in_channels)})'
66 raise ValueError(error_msg)
67
68 def _make_one_branch(self,
69 branch_index,

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected