(self, img)
| 155 | self.linear_head = nn.LayerNorm(dim) |
| 156 | |
| 157 | def forward(self, img): |
| 158 | device = img.device |
| 159 | |
| 160 | x = self.to_patch_embedding(img) |
| 161 | x += self.pos_embedding.to(device, dtype=x.dtype) |
| 162 | |
| 163 | x = self.transformer(x) |
| 164 | x = x.mean(dim=1) |
| 165 | |
| 166 | x = self.to_latent(x) |
| 167 | return self.linear_head(x) |
| 168 | |
| 169 | |
| 170 | # import torch |
nothing calls this directly
no outgoing calls
no test coverage detected