diff --git a/PyTorch/SpeechSynthesis/FastPitch/common/stft.py b/PyTorch/SpeechSynthesis/FastPitch/common/stft.py index bc140c142..6a6cfc567 100644 --- a/PyTorch/SpeechSynthesis/FastPitch/common/stft.py +++ b/PyTorch/SpeechSynthesis/FastPitch/common/stft.py @@ -123,7 +123,7 @@ def inverse(self, magnitude, phase): np.where(window_sum > tiny(window_sum))[0]) window_sum = torch.autograd.Variable( torch.from_numpy(window_sum), requires_grad=False) - window_sum = window_sum.cuda() if magnitude.is_cuda else window_sum + window_sum = window_sum.cuda(inverse_transform.get_device()) if magnitude.is_cuda else window_sum inverse_transform[:, :, approx_nonzero_indices] /= window_sum[approx_nonzero_indices] # scale by hop ratio