upstream ports

This commit is contained in:
Vladimir Mandic
2023-06-10 18:23:26 -04:00
parent f63dd1c92e
commit 409c9d4c9d
12 changed files with 44 additions and 42 deletions
+1 -2
View File
@@ -121,7 +121,6 @@ class TransformerSALayer(nn.Module):
tgt_mask: Optional[Tensor] = None,
tgt_key_padding_mask: Optional[Tensor] = None,
query_pos: Optional[Tensor] = None):
# self attention
tgt2 = self.norm1(tgt)
q = k = self.with_pos_embed(tgt2, query_pos)
@@ -275,4 +274,4 @@ class CodeFormer(VQAutoEncoder):
x = self.fuse_convs_dict[f_size](enc_feat_dict[f_size].detach(), x, w)
out = x
# logits doesn't need softmax before cross_entropy loss
return out, logits, lq_feat
return out, logits, lq_feat