Upgrade waveflow api to 1.8.2
This commit is contained in:
parent
b7c584e2f7
commit
33ed693ccf
|
@ -40,7 +40,7 @@ sudo apt-get install libsndfile1
|
|||
|
||||
### Install PaddlePaddle
|
||||
|
||||
See [install](https://www.paddlepaddle.org.cn/install/quick) for more details. This repo requires PaddlePaddle **1.8.0** or above.
|
||||
See [install](https://www.paddlepaddle.org.cn/install/quick) for more details. This repo requires PaddlePaddle **1.8.2** or above.
|
||||
|
||||
### Install Parakeet
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class Conditioner(dg.Layer):
|
|||
stride=(1, s),
|
||||
param_attr=param_attr,
|
||||
bias_attr=bias_attr,
|
||||
dtype="float32")
|
||||
dtype=dtype)
|
||||
self.upsample_conv2d.append(conv_trans2d)
|
||||
|
||||
for i, layer in enumerate(self.upsample_conv2d):
|
||||
|
@ -88,12 +88,7 @@ class Conditioner(dg.Layer):
|
|||
def forward(self, x):
|
||||
x = fluid.layers.unsqueeze(x, 1)
|
||||
for layer in self.upsample_conv2d:
|
||||
in_dtype = x.dtype
|
||||
if in_dtype == fluid.core.VarDesc.VarType.FP16:
|
||||
x = fluid.layers.cast(x, "float32")
|
||||
x = layer(x)
|
||||
if in_dtype == fluid.core.VarDesc.VarType.FP16:
|
||||
x = fluid.layers.cast(x, "float16")
|
||||
x = fluid.layers.leaky_relu(x, alpha=0.4)
|
||||
|
||||
return fluid.layers.squeeze(x, [1])
|
||||
|
@ -101,12 +96,7 @@ class Conditioner(dg.Layer):
|
|||
def infer(self, x):
|
||||
x = fluid.layers.unsqueeze(x, 1)
|
||||
for layer in self.upsample_conv2d:
|
||||
in_dtype = x.dtype
|
||||
if in_dtype == fluid.core.VarDesc.VarType.FP16:
|
||||
x = fluid.layers.cast(x, "float32")
|
||||
x = layer(x)
|
||||
if in_dtype == fluid.core.VarDesc.VarType.FP16:
|
||||
x = fluid.layers.cast(x, "float16")
|
||||
# Trim conv artifacts.
|
||||
time_cutoff = layer._filter_size[1] - layer._stride[1]
|
||||
x = fluid.layers.leaky_relu(x[:, :, :, :-time_cutoff], alpha=0.4)
|
||||
|
|
Loading…
Reference in New Issue