refine decoding process, merge flow and vocoder

This commit is contained in:
志浩 2024-07-10 16:31:45 +08:00
parent c2c1b66674
commit 04c2d487ed

View File

@ -615,7 +615,11 @@ class HiFTGenerator(nn.Module):
real = magnitude * torch.cos(phase)
img = magnitude * torch.sin(phase)
inverse_transform = torch.istft(
torch.cat([real.unsqueeze(-1), img.unsqueeze(-1)], dim=-1),
self.istft_params["n_fft"], self.istft_params["hop_len"], self.istft_params["n_fft"], window=self.stft_window)
# torch.cat([real.unsqueeze(-1), img.unsqueeze(-1)], dim=-1),
torch.complex(real, img),
self.istft_params["n_fft"], self.istft_params["hop_len"],
self.istft_params["n_fft"], window=self.stft_window,
return_complex=False
)
return inverse_transform.unsqueeze(-2) # unsqueeze to stay consistent with conv_transpose1d implementation