MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / _check_branches

Method _check_branches

timm/models/hrnet.py:406–416  ·  view source on GitHub ↗
(self, num_branches, blocks, num_blocks, num_inchannels, num_channels)

Source from the content-addressed store, hash-verified

404 self.fuse_act = nn.ReLU(False)
405
406 def _check_branches(self, num_branches, blocks, num_blocks, num_inchannels, num_channels):
407 error_msg = ''
408 if num_branches != len(num_blocks):
409 error_msg = 'NUM_BRANCHES({}) <> NUM_BLOCKS({})'.format(num_branches, len(num_blocks))
410 elif num_branches != len(num_channels):
411 error_msg = 'NUM_BRANCHES({}) <> NUM_CHANNELS({})'.format(num_branches, len(num_channels))
412 elif num_branches != len(num_inchannels):
413 error_msg = 'NUM_BRANCHES({}) <> NUM_INCHANNELS({})'.format(num_branches, len(num_inchannels))
414 if error_msg:
415 _logger.error(error_msg)
416 raise ValueError(error_msg)
417
418 def _make_one_branch(self, branch_index, block, num_blocks, num_channels, stride=1):
419 downsample = None

Callers 1

__init__Method · 0.95

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected