@@ -188,7 +188,7 @@ def test_istft_of_zeros(self):
188188 def test_istft_requires_overlap_windows (self ):
189189 # the window is size 1 but it hops 20 so there is a gap which throw an error
190190 stft = torch .zeros ((3 , 5 , 2 ))
191- self .assertRaises (AssertionError , torchaudio .functional .istft , stft , n_fft = 4 ,
191+ self .assertRaises (RuntimeError , torchaudio .functional .istft , stft , n_fft = 4 ,
192192 hop_length = 20 , win_length = 1 , window = torch .ones (1 ))
193193
194194 def test_istft_requires_nola (self ):
@@ -208,11 +208,11 @@ def test_istft_requires_nola(self):
208208 # A window of ones meets NOLA but a window of zeros does not. This should
209209 # throw an error.
210210 torchaudio .functional .istft (stft , ** kwargs_ok )
211- self .assertRaises (AssertionError , torchaudio .functional .istft , stft , ** kwargs_not_ok )
211+ self .assertRaises (RuntimeError , torchaudio .functional .istft , stft , ** kwargs_not_ok )
212212
213213 def test_istft_requires_non_empty (self ):
214- self .assertRaises (AssertionError , torchaudio .functional .istft , torch .zeros ((3 , 0 , 2 )), 2 )
215- self .assertRaises (AssertionError , torchaudio .functional .istft , torch .zeros ((0 , 3 , 2 )), 2 )
214+ self .assertRaises (RuntimeError , torchaudio .functional .istft , torch .zeros ((3 , 0 , 2 )), 2 )
215+ self .assertRaises (RuntimeError , torchaudio .functional .istft , torch .zeros ((0 , 3 , 2 )), 2 )
216216
217217 def _test_istft_of_sine (self , amplitude , L , n ):
218218 # stft of amplitude*sin(2*pi/L*n*x) with the hop length and window size equaling L
0 commit comments