(self, text_embeds: torch.FloatTensor, image_embeds: torch.FloatTensor)
| 375 | self.text_proj = nn.Linear(text_embed_dim, cross_attention_dim) |
| 376 | |
| 377 | def forward(self, text_embeds: torch.FloatTensor, image_embeds: torch.FloatTensor): |
| 378 | batch_size = text_embeds.shape[0] |
| 379 | |
| 380 | # image |
| 381 | image_text_embeds = self.image_embeds(image_embeds) |
| 382 | image_text_embeds = image_text_embeds.reshape(batch_size, self.num_image_text_embeds, -1) |
| 383 | |
| 384 | # text |
| 385 | text_embeds = self.text_proj(text_embeds) |
| 386 | |
| 387 | return torch.cat([image_text_embeds, text_embeds], dim=1) |
| 388 | |
| 389 | |
| 390 | class CombinedTimestepLabelEmbeddings(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected