Merge pull request #54 from iclementine/wavenet_fix

fix wavenet
This commit is contained in:
Li Fuchen 2020-12-16 19:19:35 +08:00 committed by GitHub
commit ddd9cdfbd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -599,14 +599,13 @@ class ConditionalWaveNet(nn.Layer):
self.decoder.start_sequence() self.decoder.start_sequence()
x_t = paddle.zeros((batch_size, ), dtype=mel.dtype) x_t = paddle.zeros((batch_size, ), dtype=mel.dtype)
for i in trange(time_steps): for i in trange(time_steps):
c_t = condition[:, :, i] c_t = condition[:, :, i] # (B, C)
y_t = self.decoder.add_input(x_t, c_t) y_t = self.decoder.add_input(x_t, c_t) #(B, C)
y_t = paddle.unsqueeze(y_t, 1) y_t = paddle.unsqueeze(y_t, 1)
x_t = self.sample(y_t) x_t = self.sample(y_t) # (B, 1)
x_t = paddle.squeeze(x_t, 1) x_t = paddle.squeeze(x_t, 1) #(B,)
samples.append(x_t) samples.append(x_t)
samples = paddle.stack(samples, -1)
samples = paddle.concat(samples, -1)
return samples return samples
@paddle.no_grad() @paddle.no_grad()