(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768)
| 202 | """ Image to Patch Embedding |
| 203 | """ |
| 204 | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768): |
| 205 | super().__init__() |
| 206 | img_size = to_2tuple(img_size) |
| 207 | patch_size = to_2tuple(patch_size) |
| 208 | num_patches = (img_size[1] // patch_size[1]) * (img_size[0] // patch_size[0]) |
| 209 | self.img_size = img_size |
| 210 | self.patch_size = patch_size |
| 211 | self.num_patches = num_patches |
| 212 | self.norm = nn.LayerNorm(embed_dim) |
| 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 |
nothing calls this directly
no test coverage detected