From dcd69601b0128a03abf6afae741a081a2343e1e2 Mon Sep 17 00:00:00 2001 From: Yuanyuan Wei Date: Sat, 7 Jun 2025 14:56:46 +0000 Subject: [PATCH 1/3] Fix `ValueError: bad delimiter value` in Python 3.13 ``` FAILED test/torchaudio_unittest/datasets/cmuarctic_test.py::TestCMUARCTIC::test_cmuarctic_path - ValueError: bad delimiter value FAILED test/torchaudio_unittest/datasets/cmuarctic_test.py::TestCMUARCTIC::test_cmuarctic_str - ValueError: bad delimiter value ``` --- src/torchaudio/datasets/cmuarctic.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/torchaudio/datasets/cmuarctic.py b/src/torchaudio/datasets/cmuarctic.py index 96f498f00f..4b86b5da8c 100644 --- a/src/torchaudio/datasets/cmuarctic.py +++ b/src/torchaudio/datasets/cmuarctic.py @@ -1,4 +1,3 @@ -import csv import os from pathlib import Path from typing import Tuple, Union @@ -129,8 +128,7 @@ def __init__( self._text = os.path.join(self._path, self._folder_text, self._file_text) with open(self._text, "r") as text: - walker = csv.reader(text, delimiter="\n") - self._walker = list(walker) + self._walker = [[line.strip()] for line in text if line.strip()] def __getitem__(self, n: int) -> Tuple[Tensor, int, str, str]: """Load the n-th sample from the dataset. From 13e3043997e30bfc33ad3fce9ed385599833db31 Mon Sep 17 00:00:00 2001 From: Yuanyuan Wei Date: Sat, 7 Jun 2025 22:45:55 +0000 Subject: [PATCH 2/3] Fix `FutureWarning: functools.partial` in Python 3.13 `FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in staticmethod() if you want to preserve the old behavior` --- .../backend/dispatcher/ffmpeg/info_test.py | 12 ++++++------ .../backend/dispatcher/ffmpeg/load_test.py | 10 +++++----- .../backend/dispatcher/ffmpeg/save_test.py | 6 +++--- .../backend/dispatcher/soundfile/info_test.py | 4 ++-- .../backend/dispatcher/soundfile/load_test.py | 8 ++++---- .../backend/dispatcher/soundfile/save_test.py | 8 ++++---- .../backend/dispatcher/sox/info_test.py | 10 +++++----- .../backend/dispatcher/sox/load_test.py | 8 ++++---- .../backend/dispatcher/sox/roundtrip_test.py | 4 ++-- .../backend/dispatcher/sox/save_test.py | 6 +++--- .../backend/dispatcher/sox/smoke_test.py | 6 +++--- 11 files changed, 41 insertions(+), 41 deletions(-) diff --git a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/info_test.py b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/info_test.py index 58a085636b..fea56fe47e 100644 --- a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/info_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/info_test.py @@ -34,7 +34,7 @@ @skipIfNoExec("sox") @skipIfNoFFmpeg class TestInfo(TempDirMixin, PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) def test_pathlike(self): """FFmpeg dispatcher can query audio data from pathlike object""" @@ -315,7 +315,7 @@ def test_gsm(self): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestInfoOpus(PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) @parameterized.expand( list( @@ -341,7 +341,7 @@ def test_opus(self, bitrate, num_channels, compression_level): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestLoadWithoutExtension(PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) def test_mp3(self): """MP3 file without extension can be loaded @@ -405,7 +405,7 @@ def read(self, n): @skipIfNoExec("sox") class TestFileObject(FileObjTestBase, PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) def _query_fileobj(self, ext, dtype, sample_rate, num_channels, num_frames, *, comments=None): path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames, comments=comments) @@ -557,7 +557,7 @@ def test_tarfile(self, ext, dtype): @skipIfNoExec("sox") @skipIfNoModule("requests") class TestFileObjectHttp(HttpServerMixin, FileObjTestBase, PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) def _query_http(self, ext, dtype, sample_rate, num_channels, num_frames): audio_path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames) @@ -600,7 +600,7 @@ def test_requests(self, ext, dtype): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestInfoNoSuchFile(PytorchTestCase): - _info = partial(get_info_func(), backend="ffmpeg") + _info = staticmethod(partial(get_info_func(), backend="ffmpeg")) def test_info_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/load_test.py b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/load_test.py index 8d1741e129..d57b54d2ee 100644 --- a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/load_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/load_test.py @@ -33,7 +33,7 @@ class LoadTestBase(TempDirMixin, PytorchTestCase): - _load = partial(get_load_func(), backend="ffmpeg") + _load = staticmethod(partial(get_load_func(), backend="ffmpeg")) def assert_format( self, @@ -324,7 +324,7 @@ def test_amb(self, dtype, num_channels, normalize, sample_rate=8000): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestLoadWithoutExtension(PytorchTestCase): - _load = partial(get_load_func(), backend="ffmpeg") + _load = staticmethod(partial(get_load_func(), backend="ffmpeg")) def test_mp3(self): """MP3 file without extension can be loaded @@ -364,7 +364,7 @@ class TestFileObject(TempDirMixin, PytorchTestCase): because `load` function is rigrously tested for file path inputs to match libsox's result, """ - _load = partial(get_load_func(), backend="ffmpeg") + _load = staticmethod(partial(get_load_func(), backend="ffmpeg")) @parameterized.expand( [ @@ -541,7 +541,7 @@ def read(self, n): @skipIfNoExec("sox") @skipIfNoModule("requests") class TestFileObjectHttp(HttpServerMixin, PytorchTestCase): - _load = partial(get_load_func(), backend="ffmpeg") + _load = staticmethod(partial(get_load_func(), backend="ffmpeg")) @parameterized.expand( [ @@ -606,7 +606,7 @@ def test_frame(self, frame_offset, num_frames): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestLoadNoSuchFile(PytorchTestCase): - _load = partial(get_load_func(), backend="ffmpeg") + _load = staticmethod(partial(get_load_func(), backend="ffmpeg")) def test_load_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py index 3fd9b70319..510b450377 100644 --- a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py @@ -41,7 +41,7 @@ def _convert_audio_file(src_path, dst_path, muxer=None, encoder=None, sample_fmt class SaveTestBase(TempDirMixin, TorchaudioTestCase): - _save = partial(get_save_func(), backend="ffmpeg") + _save = staticmethod(partial(get_save_func(), backend="ffmpeg")) def assert_save_consistency( self, @@ -398,7 +398,7 @@ def test_save_multi_channels(self, num_channels): class TestSaveParams(TempDirMixin, PytorchTestCase): """Test the correctness of optional parameters of `self._save`""" - _save = partial(get_save_func(), backend="ffmpeg") + _save = staticmethod(partial(get_save_func(), backend="ffmpeg")) @parameterized.expand([(True,), (False,)], name_func=name_func) def test_save_channels_first(self, channels_first): @@ -444,7 +444,7 @@ def test_save_tensor_preserve(self, dtype): @skipIfNoExec("sox") @skipIfNoFFmpeg class TestSaveNonExistingDirectory(PytorchTestCase): - _save = partial(get_save_func(), backend="ffmpeg") + _save = staticmethod(partial(get_save_func(), backend="ffmpeg")) def test_save_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/soundfile/info_test.py b/test/torchaudio_unittest/backend/dispatcher/soundfile/info_test.py index f01934cfd5..e100063c15 100644 --- a/test/torchaudio_unittest/backend/dispatcher/soundfile/info_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/soundfile/info_test.py @@ -24,7 +24,7 @@ @skipIfNoModule("soundfile") class TestInfo(TempDirMixin, PytorchTestCase): - _info = partial(get_info_func(), backend="soundfile") + _info = staticmethod(partial(get_info_func(), backend="soundfile")) @parameterize( ["float32", "int32", "int16", "uint8"], @@ -127,7 +127,7 @@ class MockSoundFileInfo: @skipIfNoModule("soundfile") class TestFileObject(TempDirMixin, PytorchTestCase): - _info = partial(get_info_func(), backend="soundfile") + _info = staticmethod(partial(get_info_func(), backend="soundfile")) def _test_fileobj(self, ext, subtype, bits_per_sample): """Query audio via file-like object works""" diff --git a/test/torchaudio_unittest/backend/dispatcher/soundfile/load_test.py b/test/torchaudio_unittest/backend/dispatcher/soundfile/load_test.py index e4e2f62f8a..984ec1c11c 100644 --- a/test/torchaudio_unittest/backend/dispatcher/soundfile/load_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/soundfile/load_test.py @@ -97,7 +97,7 @@ def __exit__(self, *args, **kwargs): class MockedLoadTest(PytorchTestCase): - _load = partial(get_load_func(), backend="soundfile") + _load = staticmethod(partial(get_load_func(), backend="soundfile")) def assert_dtype(self, ext, dtype, sample_rate, num_channels, normalize, channels_first): """When format is WAV or NIST, normalize=False will return the native dtype Tensor, otherwise float32""" @@ -143,7 +143,7 @@ def test_flac(self, sample_rate, num_channels, normalize, channels_first): class LoadTestBase(TempDirMixin, PytorchTestCase): - _load = partial(get_load_func(), backend="soundfile") + _load = staticmethod(partial(get_load_func(), backend="soundfile")) def assert_wav( self, @@ -272,7 +272,7 @@ def test_flac(self, dtype, sample_rate, num_channels, channels_first): class TestLoadFormat(TempDirMixin, PytorchTestCase): """Given `format` parameter, `so.load` can load files without extension""" - _load = partial(get_load_func(), backend="soundfile") + _load = staticmethod(partial(get_load_func(), backend="soundfile")) original = None path = None @@ -314,7 +314,7 @@ def test_flac(self, format_): @skipIfNoModule("soundfile") class TestFileObject(TempDirMixin, PytorchTestCase): - _load = partial(get_load_func(), backend="soundfile") + _load = staticmethod(partial(get_load_func(), backend="soundfile")) def _test_fileobj(self, ext): """Loading audio via file-like object works""" diff --git a/test/torchaudio_unittest/backend/dispatcher/soundfile/save_test.py b/test/torchaudio_unittest/backend/dispatcher/soundfile/save_test.py index d8933adff4..65b931f0c9 100644 --- a/test/torchaudio_unittest/backend/dispatcher/soundfile/save_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/soundfile/save_test.py @@ -21,7 +21,7 @@ class MockedSaveTest(PytorchTestCase): - _save = partial(get_save_func(), backend="soundfile") + _save = staticmethod(partial(get_save_func(), backend="soundfile")) @nested_params( ["float32", "int32", "int16", "uint8"], @@ -168,7 +168,7 @@ def test_ogg(self, dtype, sample_rate, num_channels, channels_first): @skipIfNoModule("soundfile") class SaveTestBase(TempDirMixin, PytorchTestCase): - _save = partial(get_save_func(), backend="soundfile") + _save = staticmethod(partial(get_save_func(), backend="soundfile")) def assert_wav(self, dtype, sample_rate, num_channels, num_frames): """`self._save` can save wav format.""" @@ -264,7 +264,7 @@ def test_ogg(self, sample_rate, num_channels): class TestSaveParams(TempDirMixin, PytorchTestCase): """Test the correctness of optional parameters of `self._save`""" - _save = partial(get_save_func(), backend="soundfile") + _save = staticmethod(partial(get_save_func(), backend="soundfile")) @parameterize([True, False]) def test_channels_first(self, channels_first): @@ -279,7 +279,7 @@ def test_channels_first(self, channels_first): @skipIfNoModule("soundfile") class TestFileObject(TempDirMixin, PytorchTestCase): - _save = partial(get_save_func(), backend="soundfile") + _save = staticmethod(partial(get_save_func(), backend="soundfile")) def _test_fileobj(self, ext): """Saving audio to file-like object works""" diff --git a/test/torchaudio_unittest/backend/dispatcher/sox/info_test.py b/test/torchaudio_unittest/backend/dispatcher/sox/info_test.py index ac78a93d11..b3444836a6 100644 --- a/test/torchaudio_unittest/backend/dispatcher/sox/info_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/sox/info_test.py @@ -31,7 +31,7 @@ @skipIfNoExec("sox") @skipIfNoSox class TestInfo(TempDirMixin, PytorchTestCase): - _info = partial(get_info_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) @parameterized.expand( list( @@ -262,7 +262,7 @@ def test_htk(self): @disabledInCI @skipIfNoSoxDecoder("opus") class TestInfoOpus(PytorchTestCase): - _info = partial(get_info_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) @parameterized.expand( list( @@ -321,7 +321,7 @@ def read(self, n): @skipIfNoSox @skipIfNoExec("sox") class TestFileObject(FileObjTestBase, PytorchTestCase): - _info = partial(get_info_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) def _query_fileobj(self, ext, dtype, sample_rate, num_channels, num_frames, *, comments=None): path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames, comments=comments) @@ -353,7 +353,7 @@ def test_fileobj(self, ext, dtype): @skipIfNoExec("sox") @skipIfNoModule("requests") class TestFileObjectHttp(HttpServerMixin, FileObjTestBase, PytorchTestCase): - _info = partial(get_info_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) def _query_http(self, ext, dtype, sample_rate, num_channels, num_frames): audio_path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames) @@ -387,7 +387,7 @@ def test_requests(self, ext, dtype): @skipIfNoSox class TestInfoNoSuchFile(PytorchTestCase): - _info = partial(get_info_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) def test_info_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/sox/load_test.py b/test/torchaudio_unittest/backend/dispatcher/sox/load_test.py index efa5808b58..223343d721 100644 --- a/test/torchaudio_unittest/backend/dispatcher/sox/load_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/sox/load_test.py @@ -22,7 +22,7 @@ class LoadTestBase(TempDirMixin, PytorchTestCase): - _load = partial(get_load_func(), backend="sox") + _load = staticmethod(partial(get_load_func(), backend="sox")) def assert_format( self, @@ -293,7 +293,7 @@ def test_amr_nb(self): class TestLoadParams(TempDirMixin, PytorchTestCase): """Test the correctness of frame parameters of `sox_io_backend.load`""" - _load = partial(get_load_func(), backend="sox") + _load = staticmethod(partial(get_load_func(), backend="sox")) def _test(self, func, frame_offset, num_frames, channels_first, normalize): original = get_wav_data("int16", num_channels=2, normalize=False) @@ -329,7 +329,7 @@ class TestFileObject(TempDirMixin, PytorchTestCase): because `load` function is rigrously tested for file path inputs to match libsox's result, """ - _load = partial(get_load_func(), backend="sox") + _load = staticmethod(partial(get_load_func(), backend="sox")) @parameterized.expand( [ @@ -360,7 +360,7 @@ def test_fileobj(self, ext, kwargs): @skipIfNoSox class TestLoadNoSuchFile(PytorchTestCase): - _load = partial(get_load_func(), backend="sox") + _load = staticmethod(partial(get_load_func(), backend="sox")) def test_load_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/sox/roundtrip_test.py b/test/torchaudio_unittest/backend/dispatcher/sox/roundtrip_test.py index 615b8e6a5c..be10a61103 100644 --- a/test/torchaudio_unittest/backend/dispatcher/sox/roundtrip_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/sox/roundtrip_test.py @@ -13,8 +13,8 @@ class TestRoundTripIO(TempDirMixin, PytorchTestCase): """save/load round trip should not degrade data for lossless formats""" - _load = partial(get_load_func(), backend="sox") - _save = partial(get_save_func(), backend="sox") + _load = staticmethod(partial(get_load_func(), backend="sox")) + _save = staticmethod(partial(get_save_func(), backend="sox")) @parameterized.expand( list( diff --git a/test/torchaudio_unittest/backend/dispatcher/sox/save_test.py b/test/torchaudio_unittest/backend/dispatcher/sox/save_test.py index ec52e6eda3..0c19c96a05 100644 --- a/test/torchaudio_unittest/backend/dispatcher/sox/save_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/sox/save_test.py @@ -34,7 +34,7 @@ def _get_sox_encoding(encoding): class SaveTestBase(TempDirMixin, TorchaudioTestCase): - _save = partial(get_save_func(), backend="sox") + _save = staticmethod(partial(get_save_func(), backend="sox")) def assert_save_consistency( self, @@ -361,7 +361,7 @@ def test_save_multi_channels(self, num_channels): class TestSaveParams(TempDirMixin, PytorchTestCase): """Test the correctness of optional parameters of `self._save`""" - _save = partial(get_save_func(), backend="sox") + _save = staticmethod(partial(get_save_func(), backend="sox")) @parameterized.expand([(True,), (False,)], name_func=name_func) def test_save_channels_first(self, channels_first): @@ -405,7 +405,7 @@ def test_save_tensor_preserve(self, dtype): @skipIfNoSox class TestSaveNonExistingDirectory(PytorchTestCase): - _save = partial(get_save_func(), backend="sox") + _save = staticmethod(partial(get_save_func(), backend="sox")) def test_save_fail(self): """ diff --git a/test/torchaudio_unittest/backend/dispatcher/sox/smoke_test.py b/test/torchaudio_unittest/backend/dispatcher/sox/smoke_test.py index 711107db5e..36cad266ed 100644 --- a/test/torchaudio_unittest/backend/dispatcher/sox/smoke_test.py +++ b/test/torchaudio_unittest/backend/dispatcher/sox/smoke_test.py @@ -19,9 +19,9 @@ class SmokeTest(TempDirMixin, TorchaudioTestCase): however without such tools, the correctness of each function cannot be verified. """ - _info = partial(get_info_func(), backend="sox") - _load = partial(get_load_func(), backend="sox") - _save = partial(get_save_func(), backend="sox") + _info = staticmethod(partial(get_info_func(), backend="sox")) + _load = staticmethod(partial(get_load_func(), backend="sox")) + _save = staticmethod(partial(get_save_func(), backend="sox")) def run_smoke_test(self, ext, sample_rate, num_channels, *, dtype="float32"): duration = 1 From 1b81ccad24878eb9705d042e07bd9d226654d13c Mon Sep 17 00:00:00 2001 From: Yuanyuan Wei Date: Sat, 7 Jun 2025 23:23:47 +0000 Subject: [PATCH 3/3] Fix `TypeError: LRScheduler.__init__()` with PyTorch 2.7 `TypeError: LRScheduler.__init__() got an unexpected keyword argument 'verbose'` --- examples/asr/emformer_rnnt/common.py | 2 +- examples/asr/librispeech_conformer_rnnt/lightning.py | 5 +---- .../asr/librispeech_conformer_rnnt_biasing/lightning.py | 5 +---- examples/avsr/schedulers.py | 3 +-- examples/hubert/lightning_modules.py | 6 ++---- .../self_supervised_learning/lr_schedulers/_linear_decay.py | 3 +-- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/examples/asr/emformer_rnnt/common.py b/examples/asr/emformer_rnnt/common.py index 19bfa85ee0..e592d92a7b 100644 --- a/examples/asr/emformer_rnnt/common.py +++ b/examples/asr/emformer_rnnt/common.py @@ -93,7 +93,7 @@ def forward(self, input): class WarmupLR(torch.optim.lr_scheduler._LRScheduler): - def __init__(self, optimizer, warmup_updates, last_epoch=-1, verbose=False): + def __init__(self, optimizer, warmup_updates, last_epoch=-1): self.warmup_updates = warmup_updates super().__init__(optimizer, last_epoch=last_epoch) diff --git a/examples/asr/librispeech_conformer_rnnt/lightning.py b/examples/asr/librispeech_conformer_rnnt/lightning.py index 8d81e25181..ea28c4ba96 100644 --- a/examples/asr/librispeech_conformer_rnnt/lightning.py +++ b/examples/asr/librispeech_conformer_rnnt/lightning.py @@ -27,8 +27,6 @@ class WarmupLR(torch.optim.lr_scheduler._LRScheduler): force_anneal_step (int): scheduler step at which annealing of learning rate begins. anneal_factor (float): factor to scale base learning rate by at each annealing step. last_epoch (int, optional): The index of last epoch. (Default: -1) - verbose (bool, optional): If ``True``, prints a message to stdout for - each update. (Default: ``False``) """ def __init__( @@ -38,12 +36,11 @@ def __init__( force_anneal_step: int, anneal_factor: float, last_epoch=-1, - verbose=False, ): self.warmup_steps = warmup_steps self.force_anneal_step = force_anneal_step self.anneal_factor = anneal_factor - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count < self.force_anneal_step: diff --git a/examples/asr/librispeech_conformer_rnnt_biasing/lightning.py b/examples/asr/librispeech_conformer_rnnt_biasing/lightning.py index 282071e558..1de73055c7 100644 --- a/examples/asr/librispeech_conformer_rnnt_biasing/lightning.py +++ b/examples/asr/librispeech_conformer_rnnt_biasing/lightning.py @@ -26,8 +26,6 @@ class WarmupLR(torch.optim.lr_scheduler._LRScheduler): force_anneal_step (int): scheduler step at which annealing of learning rate begins. anneal_factor (float): factor to scale base learning rate by at each annealing step. last_epoch (int, optional): The index of last epoch. (Default: -1) - verbose (bool, optional): If ``True``, prints a message to stdout for - each update. (Default: ``False``) """ def __init__( @@ -37,12 +35,11 @@ def __init__( force_anneal_step: int, anneal_factor: float, last_epoch=-1, - verbose=False, ): self.warmup_steps = warmup_steps self.force_anneal_step = force_anneal_step self.anneal_factor = anneal_factor - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count < self.force_anneal_step: diff --git a/examples/avsr/schedulers.py b/examples/avsr/schedulers.py index b50329ec91..eb6857106e 100644 --- a/examples/avsr/schedulers.py +++ b/examples/avsr/schedulers.py @@ -11,11 +11,10 @@ def __init__( total_epochs: int, steps_per_epoch: int, last_epoch=-1, - verbose=False, ): self.warmup_steps = warmup_epochs * steps_per_epoch self.total_steps = total_epochs * steps_per_epoch - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count < self.warmup_steps: diff --git a/examples/hubert/lightning_modules.py b/examples/hubert/lightning_modules.py index 67cb487b78..047ce06c7e 100644 --- a/examples/hubert/lightning_modules.py +++ b/examples/hubert/lightning_modules.py @@ -34,11 +34,10 @@ def __init__( warmup_updates: int, max_updates: int, last_epoch: int = -1, - verbose: bool = False, ): self.warmup_updates = warmup_updates self.max_updates = max_updates - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count <= self.warmup_updates: @@ -62,7 +61,6 @@ def __init__( init_lr_scale: float = 0.01, final_lr_scale: float = 0.05, last_epoch: int = -1, - verbose: bool = False, ): self.warmup_updates = warmup_updates self.hold_updates = hold_updates @@ -70,7 +68,7 @@ def __init__( self.init_lr_scale = init_lr_scale self.final_lr_scale = final_lr_scale - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count <= self.warmup_updates: diff --git a/examples/self_supervised_learning/lr_schedulers/_linear_decay.py b/examples/self_supervised_learning/lr_schedulers/_linear_decay.py index 67ad3f75b5..52b113e0b9 100644 --- a/examples/self_supervised_learning/lr_schedulers/_linear_decay.py +++ b/examples/self_supervised_learning/lr_schedulers/_linear_decay.py @@ -11,11 +11,10 @@ def __init__( warmup_updates: int, max_updates: int, last_epoch: int = -1, - verbose: bool = False, ): self.warmup_updates = warmup_updates self.max_updates = max_updates - super().__init__(optimizer, last_epoch=last_epoch, verbose=verbose) + super().__init__(optimizer, last_epoch=last_epoch) def get_lr(self): if self._step_count <= self.warmup_updates: