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

Method __init__

detrsmpl/models/backbones/resnet.py:15–56  ·  view source on GitHub ↗
(self,
                 inplanes,
                 planes,
                 stride=1,
                 dilation=1,
                 downsample=None,
                 style='pytorch',
                 with_cp=False,
                 conv_cfg=None,
                 norm_cfg=dict(type='BN'),
                 dcn=None,
                 plugins=None,
                 init_cfg=None)

Source from the content-addressed store, hash-verified

13 expansion = 1
14
15 def __init__(self,
16 inplanes,
17 planes,
18 stride=1,
19 dilation=1,
20 downsample=None,
21 style='pytorch',
22 with_cp=False,
23 conv_cfg=None,
24 norm_cfg=dict(type='BN'),
25 dcn=None,
26 plugins=None,
27 init_cfg=None):
28 super(BasicBlock, self).__init__(init_cfg)
29 assert dcn is None, 'Not implemented yet.'
30 assert plugins is None, 'Not implemented yet.'
31
32 self.norm1_name, norm1 = build_norm_layer(norm_cfg, planes, postfix=1)
33 self.norm2_name, norm2 = build_norm_layer(norm_cfg, planes, postfix=2)
34
35 self.conv1 = build_conv_layer(conv_cfg,
36 inplanes,
37 planes,
38 3,
39 stride=stride,
40 padding=dilation,
41 dilation=dilation,
42 bias=False)
43 self.add_module(self.norm1_name, norm1)
44 self.conv2 = build_conv_layer(conv_cfg,
45 planes,
46 planes,
47 3,
48 padding=1,
49 bias=False)
50 self.add_module(self.norm2_name, norm2)
51
52 self.relu = nn.ReLU(inplace=True)
53 self.downsample = downsample
54 self.stride = stride
55 self.dilation = dilation
56 self.with_cp = with_cp
57
58 @property
59 def norm1(self):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected