-
Notifications
You must be signed in to change notification settings - Fork 739
Closed
Milestone
Description
See #1510 for the context of this work.
We would like to issue a warning if the weight of T.MelScale is uninitialized.
For setting up dev env, please refer to CONTRIBUTING.md.
Steps
- In the constructor of
T.MelScale, add warning ifn_stft=0
audio/torchaudio/transforms.py
Lines 285 to 290 in 52e7bfd
fb = torch.empty(0) if n_stft is None else F.create_fb_matrix( n_stft, self.f_min, self.f_max, self.n_mels, self.sample_rate, self.norm, self.mel_scale) self.register_buffer('fb', fb) - In transform_test_impl.py, add a test method that constructs
MelScaleinstance withn_stft=0and the warning is issued. See this test for how to catch a warning. - Run the test with
(cd test && pytest torchaudio_unittest/transforms/transforms_*_test.py -k melscale)