MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / forward

Method forward

modules/VIPTRv2.py:291–306  ·  view source on GitHub ↗

x: (b h w c)

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

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
308class FeedForward(nn.Module):
309 def __init__(self, in_dim, hidden_dim, out_chans=None, act_layer=nn.GELU, dropout=0.):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected