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

Method forward

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

Source from the content-addressed store, hash-verified

213 self.proj = conv_3xnxn(in_chans, embed_dim, kernel_size=patch_size[0], stride=patch_size[0])
214
215 def forward(self, x):
216 B, C, T, H, W = x.shape
217 # FIXME look at relaxing size constraints
218 # assert H == self.img_size[0] and W == self.img_size[1], \
219 # f"Input image size ({H}*{W}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})."
220 x = self.proj(x)
221 B, C, T, H, W = x.shape
222 x = x.flatten(2).transpose(1, 2)
223 x = self.norm(x)
224 x = x.reshape(B, T, H, W, -1).permute(0, 4, 1, 2, 3).contiguous()
225 return x
226
227
228class PatchEmbed(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected