(
self,
image: Optional[torch.Tensor] = None,
text: Optional[torch.Tensor] = None,
ssl_dict: Optional[dict] = None,
reconstruction_image: Optional[torch.Tensor] = None,
forward_type: str = "clip",
)
| 321 | return image_logits, text_logits |
| 322 | |
| 323 | def forward( |
| 324 | self, |
| 325 | image: Optional[torch.Tensor] = None, |
| 326 | text: Optional[torch.Tensor] = None, |
| 327 | ssl_dict: Optional[dict] = None, |
| 328 | reconstruction_image: Optional[torch.Tensor] = None, |
| 329 | forward_type: str = "clip", |
| 330 | ): |
| 331 | assert forward_type in ["clip", "ssl", "rec"], "Invalid forward type" |
| 332 | |
| 333 | if forward_type == "clip": |
| 334 | return self.forward_clip(image, text) |
| 335 | elif forward_type == "ssl": |
| 336 | return self.forward_ssl_learning(**ssl_dict) |
| 337 | elif forward_type == "rec": |
| 338 | return self.forward_reconstruction(reconstruction_image) |
| 339 | |
| 340 | def forward_clip( |
| 341 | self, |
nothing calls this directly
no test coverage detected