x: (b h w c)
(self, x: torch.Tensor)
| 289 | self.ffn_layernorm.reset_parameters() |
| 290 | |
| 291 | def forward(self, x: torch.Tensor): |
| 292 | ''' |
| 293 | x: (b h w c) |
| 294 | ''' |
| 295 | x = self.fc1(x) |
| 296 | x = self.activation_fn(x) |
| 297 | x = self.activation_dropout_module(x) |
| 298 | if self.dwconv is not None: |
| 299 | residual = x |
| 300 | x = self.dwconv(x) |
| 301 | x = x + residual |
| 302 | if self.ffn_layernorm is not None: |
| 303 | x = self.ffn_layernorm(x) |
| 304 | x = self.fc2(x) |
| 305 | x = self.dropout_module(x) |
| 306 | return x |
| 307 | |
| 308 | class FeedForward(nn.Module): |
| 309 | def __init__(self, in_dim, hidden_dim, out_chans=None, act_layer=nn.GELU, dropout=0.): |
nothing calls this directly
no outgoing calls
no test coverage detected