(self, block, planes, num_blocks, stride)
| 105 | nn.init.constant_(m.bn2.weight, 0) |
| 106 | |
| 107 | def _make_layer(self, block, planes, num_blocks, stride): |
| 108 | strides = [stride] + [1] * (num_blocks - 1) |
| 109 | layers = [] |
| 110 | for i in range(num_blocks): |
| 111 | stride = strides[i] |
| 112 | layers.append(block(self.in_planes, planes, stride)) |
| 113 | self.in_planes = planes * block.expansion |
| 114 | return nn.Sequential(*layers) |
| 115 | |
| 116 | def forward(self, x, layer=100): |
| 117 | out = F.relu(self.bn1(self.conv1(x))) |