don't use +=

This commit is contained in:
erogol 2020-08-14 00:48:27 +02:00
parent 383c5f7185
commit 77c577ddab
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class Encoder(nn.Module):
# pass embedding layer
# [B ,T, D]
x = self.emb(x) * math.sqrt(self.hidden_channels)
x += self.pe[:x.shape[1]].unsqueeze(0)
x = x + self.pe[:x.shape[1]].unsqueeze(0)
# [B, D, T]
x = torch.transpose(x, 1, -1)
# compute input sequence mask