MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / __init__

Method __init__

mmseg/models/backbones/hrnet.py:21–48  ·  view source on GitHub ↗
(
        self,
        num_branches,
        blocks,
        num_blocks,
        in_channels,
        num_channels,
        multiscale_output=True,
        with_cp=False,
        conv_cfg=None,
        norm_cfg=dict(type="BN", requires_grad=True),
        block_init_cfg=None,
        init_cfg=None,
    )

Source from the content-addressed store, hash-verified

19 """
20
21 def __init__(
22 self,
23 num_branches,
24 blocks,
25 num_blocks,
26 in_channels,
27 num_channels,
28 multiscale_output=True,
29 with_cp=False,
30 conv_cfg=None,
31 norm_cfg=dict(type="BN", requires_grad=True),
32 block_init_cfg=None,
33 init_cfg=None,
34 ):
35 super(HRModule, self).__init__(init_cfg)
36 self.block_init_cfg = block_init_cfg
37 self._check_branches(num_branches, num_blocks, in_channels, num_channels)
38
39 self.in_channels = in_channels
40 self.num_branches = num_branches
41
42 self.multiscale_output = multiscale_output
43 self.norm_cfg = norm_cfg
44 self.conv_cfg = conv_cfg
45 self.with_cp = with_cp
46 self.branches = self._make_branches(num_branches, blocks, num_blocks, num_channels)
47 self.fuse_layers = self._make_fuse_layers()
48 self.relu = nn.ReLU(inplace=False)
49
50 def _check_branches(self, num_branches, num_blocks, in_channels, num_channels):
51 """Check branches configuration."""

Callers

nothing calls this directly

Calls 4

_check_branchesMethod · 0.95
_make_branchesMethod · 0.95
_make_fuse_layersMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected