| 73 | |
| 74 | |
| 75 | class ConvBNReLU(nn.Module): |
| 76 | def __init__( |
| 77 | self, |
| 78 | in_channels, |
| 79 | out_channels, |
| 80 | kernel_size, |
| 81 | stride, |
| 82 | groups=1): |
| 83 | super(ConvBNReLU, self).__init__() |
| 84 | self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size, stride=stride, |
| 85 | padding=1, groups=groups, bias=False) |
| 86 | self.norm = nn.BatchNorm2d(out_channels, eps=NORM_EPS) |
| 87 | self.act = nn.ReLU(inplace=True) |
| 88 | |
| 89 | def forward(self, x): |
| 90 | x = self.conv(x) |
| 91 | x = self.norm(x) |
| 92 | x = self.act(x) |
| 93 | return x |
| 94 | |
| 95 | |
| 96 | def _make_divisible(v, divisor, min_value=None): |