Method
_make_layer
(self,
in_channels,
out_channels,
blocks,
stride=1,
expand_ratio=6)
Source from the content-addressed store, hash-verified
| 158 | act_cfg=self.act_cfg) |
| 159 | |
| 160 | def _make_layer(self, |
| 161 | in_channels, |
| 162 | out_channels, |
| 163 | blocks, |
| 164 | stride=1, |
| 165 | expand_ratio=6): |
| 166 | layers = [ |
| 167 | InvertedResidual( |
| 168 | in_channels, |
| 169 | out_channels, |
| 170 | stride, |
| 171 | expand_ratio, |
| 172 | norm_cfg=self.norm_cfg, |
| 173 | act_cfg=self.act_cfg) |
| 174 | ] |
| 175 | for i in range(1, blocks): |
| 176 | layers.append( |
| 177 | InvertedResidual( |
| 178 | out_channels, |
| 179 | out_channels, |
| 180 | 1, |
| 181 | expand_ratio, |
| 182 | norm_cfg=self.norm_cfg, |
| 183 | act_cfg=self.act_cfg)) |
| 184 | return nn.Sequential(*layers) |
| 185 | |
| 186 | def forward(self, x): |
| 187 | x = self.bottleneck1(x) |
Tested by
no test coverage detected