MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _check_branches

Method _check_branches

detrsmpl/models/backbones/hrnet.py:49–64  ·  view source on GitHub ↗
(self, num_branches, num_blocks, in_channels,
                        num_channels)

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected