mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Modify tests to use assertWarnsOnceRegex instead of maybeWarnsRegex (#52387)
Summary: Related to https://github.com/pytorch/pytorch/issues/50006 Follow on for https://github.com/pytorch/pytorch/issues/48560 to ensure TORCH_WARN_ONCE warnings are caught. Most of this is straight-forward find-and-replace, but I did find one place where the TORCH_WARN_ONCE warning was not wrapped into a python warning. Pull Request resolved: https://github.com/pytorch/pytorch/pull/52387 Reviewed By: albanD Differential Revision: D26773387 Pulled By: mruberry fbshipit-source-id: 5be7efbc8ab4a32ec8437c9c45f3b6c3c328f5dd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d3cde6c23c
commit
54a2498919
@ -710,9 +710,8 @@ class TestFFT(TestCase):
|
||||
else:
|
||||
window = None
|
||||
if expected_error is None:
|
||||
with self.maybeWarnsRegex(UserWarning, "stft with return_complex=False"):
|
||||
result = x.stft(n_fft, hop_length, win_length, window,
|
||||
center=center, return_complex=False)
|
||||
result = x.stft(n_fft, hop_length, win_length, window,
|
||||
center=center, return_complex=False)
|
||||
# NB: librosa defaults to np.complex64 output, no matter what
|
||||
# the input dtype
|
||||
ref_result = librosa_stft(x, n_fft, hop_length, win_length, window, center)
|
||||
|
Reference in New Issue
Block a user