| 189 | self.drop_path = DropPath(drop_path) if drop_path > 0.0 else nn.Identity() |
| 190 | |
| 191 | def forward(self, x): |
| 192 | identity = x |
| 193 | x = self.dwconv(x) |
| 194 | x = x.permute(0, 2, 3, 1) |
| 195 | x = self.norm(x) |
| 196 | x = self.pwconv1(x) |
| 197 | x = self.act(x) |
| 198 | x = self.pwconv2(x) |
| 199 | if self.gamma is not None: |
| 200 | x = self.gamma * x |
| 201 | x = x.permute(0, 3, 1, 2) |
| 202 | x = identity + self.drop_path(x) |
| 203 | return x |
| 204 | |
| 205 | class DilatedConvBlock(nn.Module): |
| 206 | def __init__(self, in_channels, out_channels, dilation_rates=[1, 2, 4, 8]): |