Skip to content

Commit ce3a1bb

Browse files
committed
pytorch update
1 parent 9117ccc commit ce3a1bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dca/dca.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def make_cepts2(X, T_pi):
292292

293293
# Compute the power spectral density
294294
window = torch.Tensor(hann(Y.shape[-1])[np.newaxis, np.newaxis]).type(Y.dtype)
295-
Yf = torch.fft.rfft(Y * window, 1, onesided=True)
295+
Yf = torch.fft.rfft(Y * window, dim=1)
296296
spect = Yf[:, :, :, 0]**2 + Yf[:, :, :, 1]**2
297297
spect = spect.mean(dim=1)
298298
spect = torch.cat([torch.flip(spect[:, 1:], dims=(1,)), spect], dim=1)
@@ -301,7 +301,7 @@ def make_cepts2(X, T_pi):
301301
logspect = torch.log(spect) - np.log(float(Y.shape[-1]))
302302

303303
# Compute squared cepstral coefs (b_k^2)
304-
cepts = torch.fft.rfft(logspect, 1, onesided=True) / float(Y.shape[-1])
304+
cepts = torch.fft.rfft(logspect, dim=1) / float(Y.shape[-1])
305305
cepts = torch.sqrt(cepts[:, :, 0]**2 + cepts[:, :, 1]**2)
306306
return cepts**2
307307

0 commit comments

Comments
 (0)