temporary fix for memory leak

This commit is contained in:
chenfeiyu 2020-12-03 14:51:25 +08:00
parent 9cb5c03069
commit 404add2caa
2 changed files with 1 additions and 7 deletions

View File

@ -483,7 +483,7 @@ class ConditionalWaveFlow(nn.LayerList):
z, log_det_jacobian = self.decoder(audio, condition)
return z, log_det_jacobian
@paddle.no_grad()
@paddle.fluid.dygraph.no_grad
def synthesize(self, mel):
condition = self.encoder(mel, trim_conv_artifact=True) #(B, C, T)
batch_size, _, time_steps = condition.shape

View File

@ -23,9 +23,3 @@ def masked_l1_loss(prediction, target, mask):
def masked_softmax_with_cross_entropy(logits, label, mask, axis=-1):
ce = F.softmax_with_cross_entropy(logits, label, axis=axis)
return weighted_mean(ce, mask)