File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,7 @@ def istft(stft_matrix, # type: Tensor
89
89
90
90
Args:
91
91
stft_matrix (torch.Tensor): Output of stft where each row of a batch is a frequency and each
92
- column is a window. it has a shape of either (batch, fft_size, n_frames, 2) or (
93
- fft_size, n_frames, 2)
92
+ column is a window. it has a shape of (fft_size, n_frames, 2)
94
93
n_fft (int): Size of Fourier transform
95
94
hop_length (Optional[int]): The distance between neighboring sliding window frames.
96
95
(Default: ``win_length // 4``)
@@ -107,10 +106,13 @@ def istft(stft_matrix, # type: Tensor
107
106
108
107
Returns:
109
108
torch.Tensor: Least squares estimation of the original signal of size
110
- (batch, signal_length) or ( signal_length)
109
+ (signal_length)
111
110
"""
112
111
stft_matrix_dim = stft_matrix .dim ()
113
- assert 3 <= stft_matrix_dim <= 4 , ('Incorrect stft dimension: %d' % (stft_matrix_dim ))
112
+ # Technically this function can accept either (batch, fft_size, n_frames, 2) or
113
+ # (fft_size, n_frames, 2). But going to temporarily remove batch support (
114
+ # through adding an assert) to make torchaudio functions consistent.
115
+ assert stft_matrix_dim == 3 , ('Incorrect stft dimension: %d' % (stft_matrix_dim ))
114
116
115
117
if stft_matrix_dim == 3 :
116
118
# add a batch dimension
You can’t perform that action at this time.
0 commit comments