MCPcopy
hub / github.com/datalab-to/surya / __init__

Method __init__

surya/detection/model/encoderdecoder.py:98–130  ·  view source on GitHub ↗
(
        self,
        in_channels: int,
        out_channels: int,
        kernel_size=3,
        stride=1,
        use_bias=False,
        norm_layer=(nn.BatchNorm2d, nn.BatchNorm2d),
        act_layer=(nn.ReLU6, None),
    )

Source from the content-addressed store, hash-verified

96
97class DSConv(nn.Module):
98 def __init__(
99 self,
100 in_channels: int,
101 out_channels: int,
102 kernel_size=3,
103 stride=1,
104 use_bias=False,
105 norm_layer=(nn.BatchNorm2d, nn.BatchNorm2d),
106 act_layer=(nn.ReLU6, None),
107 ):
108 super(DSConv, self).__init__()
109 use_bias = val2tuple(use_bias, 2)
110 norm_layer = val2tuple(norm_layer, 2)
111 act_layer = val2tuple(act_layer, 2)
112
113 self.depth_conv = ConvNormAct(
114 in_channels,
115 in_channels,
116 kernel_size,
117 stride,
118 groups=in_channels,
119 norm_layer=norm_layer[0],
120 act_layer=act_layer[0],
121 bias=use_bias[0],
122 )
123 self.point_conv = ConvNormAct(
124 in_channels,
125 out_channels,
126 1,
127 norm_layer=norm_layer[1],
128 act_layer=act_layer[1],
129 bias=use_bias[1],
130 )
131
132 def forward(self, x):
133 x = self.depth_conv(x)

Callers

nothing calls this directly

Calls 3

val2tupleFunction · 0.85
ConvNormActClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected