(self, seq_len, latent_dim, num_head, dropout, time_embed_dim)
| 196 | class TemporalSelfAttention(nn.Module): |
| 197 | |
| 198 | def __init__(self, seq_len, latent_dim, num_head, dropout, time_embed_dim): |
| 199 | super().__init__() |
| 200 | self.num_head = num_head |
| 201 | self.norm = nn.LayerNorm(latent_dim) |
| 202 | self.query = nn.Linear(latent_dim, latent_dim) |
| 203 | self.key = nn.Linear(latent_dim, latent_dim) |
| 204 | self.value = nn.Linear(latent_dim, latent_dim) |
| 205 | self.dropout = nn.Dropout(dropout) |
| 206 | self.proj_out = StylizationBlock(latent_dim, time_embed_dim, dropout) |
| 207 | |
| 208 | def forward(self, x, emb, src_mask): |
| 209 | """ |
nothing calls this directly
no test coverage detected