Skip to content

Commit 4983bfc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0c1609e commit 4983bfc

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

modulation/data/signal_generator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def multifreq(x: numpy.ndarray) -> numpy.ndarray:
2626

2727

2828
def triangle(x: numpy.ndarray, section_length: float = 0.5) -> numpy.ndarray:
29-
3029
section0 = x < section_length
3130
section1 = (x >= section_length) & (x < 2 * section_length)
3231
section2 = (x >= 2 * section_length) & (x < 3 * section_length)
@@ -40,7 +39,6 @@ def triangle(x: numpy.ndarray, section_length: float = 0.5) -> numpy.ndarray:
4039

4140

4241
def sawtooth(x: numpy.ndarray, section_length: float = 0.5) -> numpy.ndarray:
43-
4442
section0 = x < section_length
4543
section1 = (x >= section_length) & (x < 2 * section_length)
4644
section2 = (x >= 2 * section_length) & (x < 3 * section_length)

tests/regression/reconstruction/torch_audio_demo.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class TestFunctional(unittest.TestCase):
4949
waveform_train, sr_train = torchaudio.load(test_filepath)
5050

5151
def test_torchscript_spectrogram(self):
52-
5352
tensor = torch.rand((1, 1000))
5453
n_fft = 400
5554
ws = 400
@@ -92,7 +91,6 @@ def test_torchscript_griffinlim(self):
9291
)
9392

9493
def test_batch_griffinlim(self):
95-
9694
torch.random.manual_seed(42)
9795
tensor = torch.rand((1, 201, 6))
9896

@@ -423,7 +421,6 @@ def test_linearity_of_istft4(self):
423421
self._test_linearity_of_istft(data_size, kwargs4, atol=1e-5, rtol=1e-8)
424422

425423
def test_batch_istft(self):
426-
427424
stft = torch.tensor(
428425
[
429426
[[4.0, 0.0], [4.0, 0.0], [4.0, 0.0], [4.0, 0.0], [4.0, 0.0]],
@@ -437,7 +434,6 @@ def test_batch_istft(self):
437434
def _test_create_fb(
438435
self, n_mels=40, sample_rate=22050, n_fft=2048, fmin=0.0, fmax=8000.0
439436
):
440-
441437
librosa_fb = librosa.filters.mel(
442438
sr=sample_rate,
443439
n_fft=n_fft,
@@ -556,7 +552,6 @@ def test_pitch(self):
556552
self._test_batch(F.detect_pitch_frequency, waveform, sample_rate)
557553

558554
def _test_batch_shape(self, functional, tensor, *args, **kwargs):
559-
560555
kwargs_compare = {}
561556
if "atol" in kwargs:
562557
atol = kwargs["atol"]
@@ -586,7 +581,6 @@ def _test_batch_shape(self, functional, tensor, *args, **kwargs):
586581
return tensors, expected
587582

588583
def _test_batch(self, functional, tensor, *args, **kwargs):
589-
590584
tensors, expected = self._test_batch_shape(functional, tensor, *args, **kwargs)
591585

592586
kwargs_compare = {}
@@ -612,7 +606,6 @@ def _test_batch(self, functional, tensor, *args, **kwargs):
612606
computed = functional(tensors.clone(), *args, **kwargs)
613607

614608
def test_torchscript_create_fb_matrix(self):
615-
616609
n_stft = 100
617610
f_min = 0.0
618611
f_max = 20.0
@@ -635,7 +628,6 @@ def test_torchscript_amplitude_to_DB(self):
635628
)
636629

637630
def test_torchscript_DB_to_amplitude(self):
638-
639631
x = torch.rand((1, 100))
640632
ref = 1.0
641633
power = 1.0
@@ -685,36 +677,31 @@ def test_DB_to_amplitude(self):
685677
self.assertTrue(torch.allclose(spec, x2, atol=5e-5))
686678

687679
def test_torchscript_create_dct(self):
688-
689680
n_mfcc = 40
690681
n_mels = 128
691682
norm = "ortho"
692683

693684
_test_torchscript_functional(F.create_dct, n_mfcc, n_mels, norm)
694685

695686
def test_torchscript_mu_law_encoding(self):
696-
697687
tensor = torch.rand((1, 10))
698688
qc = 256
699689

700690
_test_torchscript_functional(F.mu_law_encoding, tensor, qc)
701691

702692
def test_torchscript_mu_law_decoding(self):
703-
704693
tensor = torch.rand((1, 10))
705694
qc = 256
706695

707696
_test_torchscript_functional(F.mu_law_decoding, tensor, qc)
708697

709698
def test_torchscript_complex_norm(self):
710-
711699
complex_tensor = torch.randn(1, 2, 1025, 400, 2)
712700
power = 2
713701

714702
_test_torchscript_functional(F.complex_norm, complex_tensor, power)
715703

716704
def test_mask_along_axis(self):
717-
718705
specgram = torch.randn(2, 1025, 400)
719706
mask_param = 100
720707
mask_value = 30.0
@@ -725,7 +712,6 @@ def test_mask_along_axis(self):
725712
)
726713

727714
def test_mask_along_axis_iid(self):
728-
729715
specgrams = torch.randn(4, 2, 1025, 400)
730716
mask_param = 100
731717
mask_value = 30.0

0 commit comments

Comments
 (0)