MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / forward

Method forward

slowfast/models/uniformer.py:153–160  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

151 self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=act_layer, drop=drop)
152
153 def forward(self, x):
154 x = x + self.pos_embed(x)
155 B, C, T, H, W = x.shape
156 x = x.flatten(2).transpose(1, 2)
157 x = x + self.drop_path(self.attn(self.norm1(x)))
158 x = x + self.drop_path(self.mlp(self.norm2(x)))
159 x = x.transpose(1, 2).reshape(B, C, T, H, W)
160 return x
161
162
163class SplitSABlock(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected