Skip to content

Commit

Permalink
Merge pull request #49 from BushyToaster88/fix-torch-stft-error-on-gp…
Browse files Browse the repository at this point in the history
…us-sm-53

fix-torch-stft-error-on-gpus-sm-53
  • Loading branch information
Plachtaa authored Mar 3, 2023
2 parents 8137fb9 + b92361b commit da3670a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mel_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def mel_spectrogram_torch(y, n_fft, num_mels, sampling_rate, hop_size, win_size,
y = torch.nn.functional.pad(y.unsqueeze(1), (int((n_fft-hop_size)/2), int((n_fft-hop_size)/2)), mode='reflect')
y = y.squeeze(1)

spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[wnsize_dtype_device],
center=center, pad_mode='reflect', normalized=False, onesided=True)
spec = torch.stft(y.float(), n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[wnsize_dtype_device],
center=center, pad_mode='reflect', normalized=False, onesided=True)

spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)

Expand Down

0 comments on commit da3670a

Please sign in to comment.