Skip to content

Commit e77ffcd

Browse files
committed
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`
1 parent dc9c6b2 commit e77ffcd

File tree

29 files changed

+121
-111
lines changed

29 files changed

+121
-111
lines changed

examples/asr/emformer_rnnt/librispeech/lightning.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,20 @@ def __init__(
7979
self.train_data_pipeline = torch.nn.Sequential(
8080
FunctionalModule(piecewise_linear_log),
8181
GlobalStatsNormalization(global_stats_path),
82-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
82+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
8383
torchaudio.transforms.FrequencyMasking(27),
8484
torchaudio.transforms.FrequencyMasking(27),
8585
torchaudio.transforms.TimeMasking(100, p=0.2),
8686
torchaudio.transforms.TimeMasking(100, p=0.2),
87-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
88-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
87+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
88+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
8989
)
9090
self.valid_data_pipeline = torch.nn.Sequential(
9191
FunctionalModule(piecewise_linear_log),
9292
GlobalStatsNormalization(global_stats_path),
93-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
94-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
95-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
93+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
94+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
95+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
9696
)
9797

9898
self.librispeech_path = librispeech_path

examples/asr/emformer_rnnt/mustc/lightning.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ def __init__(
5757
self.train_data_pipeline = torch.nn.Sequential(
5858
FunctionalModule(piecewise_linear_log),
5959
GlobalStatsNormalization(global_stats_path),
60-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
60+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
6161
torchaudio.transforms.FrequencyMasking(27),
6262
torchaudio.transforms.FrequencyMasking(27),
6363
torchaudio.transforms.TimeMasking(100, p=0.2),
6464
torchaudio.transforms.TimeMasking(100, p=0.2),
65-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
66-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
65+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
66+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
6767
)
6868
self.valid_data_pipeline = torch.nn.Sequential(
6969
FunctionalModule(piecewise_linear_log),
7070
GlobalStatsNormalization(global_stats_path),
71-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
72-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
73-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
71+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
72+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
73+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
7474
)
7575

7676
self.mustc_path = mustc_path

examples/asr/emformer_rnnt/pipeline_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class Config:
2929

3030
_CONFIGS = {
3131
MODEL_TYPE_LIBRISPEECH: Config(
32-
partial(torchaudio.datasets.LIBRISPEECH, url="test-clean"),
32+
staticmethod(partial(torchaudio.datasets.LIBRISPEECH, url="test-clean")),
3333
EMFORMER_RNNT_BASE_LIBRISPEECH,
3434
),
3535
MODEL_TYPE_MUSTC: Config(
36-
partial(MUSTC, subset="tst-COMMON"),
36+
staticmethod(partial(MUSTC, subset="tst-COMMON")),
3737
EMFORMER_RNNT_BASE_MUSTC,
3838
),
3939
MODEL_TYPE_TEDLIUM3: Config(
40-
partial(torchaudio.datasets.TEDLIUM, release="release3", subset="test"),
40+
staticmethod(partial(torchaudio.datasets.TEDLIUM, release="release3", subset="test")),
4141
EMFORMER_RNNT_BASE_TEDLIUM3,
4242
),
4343
}

examples/asr/emformer_rnnt/tedlium3/lightning.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,20 @@ def __init__(
8787
self.train_data_pipeline = torch.nn.Sequential(
8888
FunctionalModule(piecewise_linear_log),
8989
GlobalStatsNormalization(global_stats_path),
90-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
90+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
9191
torchaudio.transforms.FrequencyMasking(27),
9292
torchaudio.transforms.FrequencyMasking(27),
9393
torchaudio.transforms.TimeMasking(100, p=0.2),
9494
torchaudio.transforms.TimeMasking(100, p=0.2),
95-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
96-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
95+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
96+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
9797
)
9898
self.valid_data_pipeline = torch.nn.Sequential(
9999
FunctionalModule(piecewise_linear_log),
100100
GlobalStatsNormalization(global_stats_path),
101-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
102-
FunctionalModule(partial(torch.nn.functional.pad, pad=(0, 4))),
103-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
101+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
102+
FunctionalModule(staticmethod(partial(torch.nn.functional.pad, pad=(0, 4)))),
103+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
104104
)
105105

106106
self.tedlium_path = tedlium_path

examples/asr/librispeech_conformer_rnnt/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ def __init__(self, global_stats_path: str, sp_model_path: str):
7171
self.train_data_pipeline = torch.nn.Sequential(
7272
FunctionalModule(_piecewise_linear_log),
7373
GlobalStatsNormalization(global_stats_path),
74-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
74+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
7575
torchaudio.transforms.FrequencyMasking(27),
7676
torchaudio.transforms.FrequencyMasking(27),
7777
torchaudio.transforms.TimeMasking(100, p=0.2),
7878
torchaudio.transforms.TimeMasking(100, p=0.2),
79-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
79+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
8080
)
8181

8282
def __call__(self, samples: List):

examples/asr/librispeech_conformer_rnnt_biasing/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ def __init__(self, global_stats_path: str, sp_model_path: str, blist: List[str],
113113
self.train_data_pipeline = torch.nn.Sequential(
114114
FunctionalModule(_piecewise_linear_log),
115115
GlobalStatsNormalization(global_stats_path),
116-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
116+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
117117
torchaudio.transforms.FrequencyMasking(27),
118118
torchaudio.transforms.FrequencyMasking(27),
119119
torchaudio.transforms.TimeMasking(100, p=0.2),
120120
torchaudio.transforms.TimeMasking(100, p=0.2),
121-
FunctionalModule(partial(torch.transpose, dim0=1, dim1=2)),
121+
FunctionalModule(staticmethod(partial(torch.transpose, dim0=1, dim1=2))),
122122
)
123123
self.blist = blist
124124
self.droprate = droprate

examples/pipeline_tacotron2/inference.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,14 @@ def main(args):
253253
raise ValueError("Both --checkpoint-path and --checkpoint-name are specified, " "can only specify one.")
254254

255255
n_symbols = len(get_symbol_list(args.text_preprocessor))
256-
text_preprocessor = partial(
257-
text_to_sequence,
258-
symbol_list=args.text_preprocessor,
259-
phonemizer=args.phonemizer,
260-
checkpoint=args.phonemizer_checkpoint,
261-
cmudict_root=args.cmudict_root,
256+
text_preprocessor = staticmethod(
257+
partial(
258+
text_to_sequence,
259+
symbol_list=args.text_preprocessor,
260+
phonemizer=args.phonemizer,
261+
checkpoint=args.phonemizer_checkpoint,
262+
cmudict_root=args.cmudict_root,
263+
)
262264
)
263265

264266
if args.checkpoint_path is not None:

examples/pipeline_tacotron2/train.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,14 @@ def log_additional_info(writer, model, loader, epoch):
273273

274274

275275
def get_datasets(args):
276-
text_preprocessor = partial(
277-
text_to_sequence,
278-
symbol_list=args.text_preprocessor,
279-
phonemizer=args.phonemizer,
280-
checkpoint=args.phonemizer_checkpoint,
281-
cmudict_root=args.cmudict_root,
276+
text_preprocessor = staticmethod(
277+
partial(
278+
text_to_sequence,
279+
symbol_list=args.text_preprocessor,
280+
phonemizer=args.phonemizer,
281+
checkpoint=args.phonemizer_checkpoint,
282+
cmudict_root=args.cmudict_root,
283+
)
282284
)
283285

284286
transforms = torch.nn.Sequential(
@@ -391,7 +393,7 @@ def train(rank, world_size, args):
391393
"shuffle": False,
392394
"pin_memory": True,
393395
"drop_last": False,
394-
"collate_fn": partial(text_mel_collate_fn, n_frames_per_step=args.n_frames_per_step),
396+
"collate_fn": staticmethod(partial(text_mel_collate_fn, n_frames_per_step=args.n_frames_per_step)),
395397
}
396398

397399
train_loader = DataLoader(trainset, sampler=train_sampler, **loader_params)

examples/self_supervised_learning/train_hubert.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ def run_train(args):
115115
f"Found {args.model_name}."
116116
)
117117
model = getattr(torchaudio.models, args.model_name)()
118-
loss_fn = partial(
119-
hubert_loss,
120-
masked_weight=args.masked_weight,
121-
unmasked_weight=args.unmasked_weight,
122-
feature_weight=args.feature_weight,
118+
loss_fn = staticmethod(
119+
partial(
120+
hubert_loss,
121+
masked_weight=args.masked_weight,
122+
unmasked_weight=args.unmasked_weight,
123+
feature_weight=args.feature_weight,
124+
)
123125
)
124126
optimizer = torch.optim.AdamW(
125127
model.parameters(),

examples/source_separation/utils/dataset/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ def get_collate_fn(dataset_type, mode, sample_rate=None, duration=4):
8484
if mode == "train":
8585
if sample_rate is None:
8686
raise ValueError("sample_rate is not given.")
87-
return partial(collate_fn_wsj0mix_train, sample_rate=sample_rate, duration=duration)
88-
return partial(collate_fn_wsj0mix_test, sample_rate=sample_rate)
87+
return staticmethod(partial(collate_fn_wsj0mix_train, sample_rate=sample_rate, duration=duration))
88+
return staticmethod(partial(collate_fn_wsj0mix_test, sample_rate=sample_rate))
8989
raise ValueError(f"Unexpected dataset: {dataset_type}")

src/torchaudio/pipelines/_source_separation_pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_model(self) -> torch.nn.Module:
6161

6262
CONVTASNET_BASE_LIBRI2MIX = SourceSeparationBundle(
6363
_model_path="models/conv_tasnet_base_libri2mix.pt",
64-
_model_factory_func=partial(conv_tasnet_base, num_sources=2),
64+
_model_factory_func=staticmethod(partial(conv_tasnet_base, num_sources=2)),
6565
_sample_rate=8000,
6666
)
6767
CONVTASNET_BASE_LIBRI2MIX.__doc__ = """Pre-trained Source Separation pipeline with *ConvTasNet*
@@ -78,7 +78,7 @@ def get_model(self) -> torch.nn.Module:
7878

7979
HDEMUCS_HIGH_MUSDB_PLUS = SourceSeparationBundle(
8080
_model_path="models/hdemucs_high_trained.pt",
81-
_model_factory_func=partial(hdemucs_high, sources=["drums", "bass", "other", "vocals"]),
81+
_model_factory_func=staticmethod(partial(hdemucs_high, sources=["drums", "bass", "other", "vocals"])),
8282
_sample_rate=44100,
8383
)
8484
HDEMUCS_HIGH_MUSDB_PLUS.__doc__ = """Pre-trained music source separation pipeline with
@@ -96,7 +96,7 @@ def get_model(self) -> torch.nn.Module:
9696

9797
HDEMUCS_HIGH_MUSDB = SourceSeparationBundle(
9898
_model_path="models/hdemucs_high_musdbhq_only.pt",
99-
_model_factory_func=partial(hdemucs_high, sources=["drums", "bass", "other", "vocals"]),
99+
_model_factory_func=staticmethod(partial(hdemucs_high, sources=["drums", "bass", "other", "vocals"])),
100100
_sample_rate=44100,
101101
)
102102
HDEMUCS_HIGH_MUSDB.__doc__ = """Pre-trained music source separation pipeline with

src/torchaudio/pipelines/rnnt_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def get_token_processor(self) -> TokenProcessor:
356356

357357
EMFORMER_RNNT_BASE_LIBRISPEECH = RNNTBundle(
358358
_rnnt_path="models/emformer_rnnt_base_librispeech.pt",
359-
_rnnt_factory_func=partial(emformer_rnnt_base, num_symbols=4097),
359+
_rnnt_factory_func=staticmethod(partial(emformer_rnnt_base, num_symbols=4097)),
360360
_global_stats_path="pipeline-assets/global_stats_rnnt_librispeech.json",
361361
_sp_model_path="pipeline-assets/spm_bpe_4096_librispeech.model",
362362
_right_padding=4,

src/torchaudio/prototype/pipelines/rnnt_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
EMFORMER_RNNT_BASE_MUSTC = RNNTBundle(
88
_rnnt_path="models/emformer_rnnt_base_mustc.pt",
9-
_rnnt_factory_func=partial(emformer_rnnt_base, num_symbols=501),
9+
_rnnt_factory_func=staticmethod(partial(emformer_rnnt_base, num_symbols=501)),
1010
_global_stats_path="pipeline-assets/global_stats_rnnt_mustc.json",
1111
_sp_model_path="pipeline-assets/spm_bpe_500_mustc.model",
1212
_right_padding=4,
@@ -33,7 +33,7 @@
3333

3434
EMFORMER_RNNT_BASE_TEDLIUM3 = RNNTBundle(
3535
_rnnt_path="models/emformer_rnnt_base_tedlium3.pt",
36-
_rnnt_factory_func=partial(emformer_rnnt_base, num_symbols=501),
36+
_rnnt_factory_func=staticmethod(partial(emformer_rnnt_base, num_symbols=501)),
3737
_global_stats_path="pipeline-assets/global_stats_rnnt_tedlium3.json",
3838
_sp_model_path="pipeline-assets/spm_bpe_500_tedlium3.model",
3939
_right_padding=4,

test/torchaudio_unittest/backend/dispatcher/ffmpeg/info_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@skipIfNoExec("sox")
3535
@skipIfNoFFmpeg
3636
class TestInfo(TempDirMixin, PytorchTestCase):
37-
_info = partial(get_info_func(), backend="ffmpeg")
37+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
3838

3939
def test_pathlike(self):
4040
"""FFmpeg dispatcher can query audio data from pathlike object"""
@@ -315,7 +315,7 @@ def test_gsm(self):
315315
@skipIfNoExec("sox")
316316
@skipIfNoFFmpeg
317317
class TestInfoOpus(PytorchTestCase):
318-
_info = partial(get_info_func(), backend="ffmpeg")
318+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
319319

320320
@parameterized.expand(
321321
list(
@@ -341,7 +341,7 @@ def test_opus(self, bitrate, num_channels, compression_level):
341341
@skipIfNoExec("sox")
342342
@skipIfNoFFmpeg
343343
class TestLoadWithoutExtension(PytorchTestCase):
344-
_info = partial(get_info_func(), backend="ffmpeg")
344+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
345345

346346
def test_mp3(self):
347347
"""MP3 file without extension can be loaded
@@ -405,7 +405,7 @@ def read(self, n):
405405

406406
@skipIfNoExec("sox")
407407
class TestFileObject(FileObjTestBase, PytorchTestCase):
408-
_info = partial(get_info_func(), backend="ffmpeg")
408+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
409409

410410
def _query_fileobj(self, ext, dtype, sample_rate, num_channels, num_frames, *, comments=None):
411411
path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames, comments=comments)
@@ -557,7 +557,7 @@ def test_tarfile(self, ext, dtype):
557557
@skipIfNoExec("sox")
558558
@skipIfNoModule("requests")
559559
class TestFileObjectHttp(HttpServerMixin, FileObjTestBase, PytorchTestCase):
560-
_info = partial(get_info_func(), backend="ffmpeg")
560+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
561561

562562
def _query_http(self, ext, dtype, sample_rate, num_channels, num_frames):
563563
audio_path = self._gen_file(ext, dtype, sample_rate, num_channels, num_frames)
@@ -600,7 +600,7 @@ def test_requests(self, ext, dtype):
600600
@skipIfNoExec("sox")
601601
@skipIfNoFFmpeg
602602
class TestInfoNoSuchFile(PytorchTestCase):
603-
_info = partial(get_info_func(), backend="ffmpeg")
603+
_info = staticmethod(partial(get_info_func(), backend="ffmpeg"))
604604

605605
def test_info_fail(self):
606606
"""

test/torchaudio_unittest/backend/dispatcher/ffmpeg/load_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
class LoadTestBase(TempDirMixin, PytorchTestCase):
36-
_load = partial(get_load_func(), backend="ffmpeg")
36+
_load = staticmethod(partial(get_load_func(), backend="ffmpeg"))
3737

3838
def assert_format(
3939
self,
@@ -324,7 +324,7 @@ def test_amb(self, dtype, num_channels, normalize, sample_rate=8000):
324324
@skipIfNoExec("sox")
325325
@skipIfNoFFmpeg
326326
class TestLoadWithoutExtension(PytorchTestCase):
327-
_load = partial(get_load_func(), backend="ffmpeg")
327+
_load = staticmethod(partial(get_load_func(), backend="ffmpeg"))
328328

329329
def test_mp3(self):
330330
"""MP3 file without extension can be loaded
@@ -364,7 +364,7 @@ class TestFileObject(TempDirMixin, PytorchTestCase):
364364
because `load` function is rigrously tested for file path inputs to match libsox's result,
365365
"""
366366

367-
_load = partial(get_load_func(), backend="ffmpeg")
367+
_load = staticmethod(partial(get_load_func(), backend="ffmpeg"))
368368

369369
@parameterized.expand(
370370
[
@@ -541,7 +541,7 @@ def read(self, n):
541541
@skipIfNoExec("sox")
542542
@skipIfNoModule("requests")
543543
class TestFileObjectHttp(HttpServerMixin, PytorchTestCase):
544-
_load = partial(get_load_func(), backend="ffmpeg")
544+
_load = staticmethod(partial(get_load_func(), backend="ffmpeg"))
545545

546546
@parameterized.expand(
547547
[
@@ -606,7 +606,7 @@ def test_frame(self, frame_offset, num_frames):
606606
@skipIfNoExec("sox")
607607
@skipIfNoFFmpeg
608608
class TestLoadNoSuchFile(PytorchTestCase):
609-
_load = partial(get_load_func(), backend="ffmpeg")
609+
_load = staticmethod(partial(get_load_func(), backend="ffmpeg"))
610610

611611
def test_load_fail(self):
612612
"""

test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _convert_audio_file(src_path, dst_path, muxer=None, encoder=None, sample_fmt
4141

4242

4343
class SaveTestBase(TempDirMixin, TorchaudioTestCase):
44-
_save = partial(get_save_func(), backend="ffmpeg")
44+
_save = staticmethod(partial(get_save_func(), backend="ffmpeg"))
4545

4646
def assert_save_consistency(
4747
self,
@@ -398,7 +398,7 @@ def test_save_multi_channels(self, num_channels):
398398
class TestSaveParams(TempDirMixin, PytorchTestCase):
399399
"""Test the correctness of optional parameters of `self._save`"""
400400

401-
_save = partial(get_save_func(), backend="ffmpeg")
401+
_save = staticmethod(partial(get_save_func(), backend="ffmpeg"))
402402

403403
@parameterized.expand([(True,), (False,)], name_func=name_func)
404404
def test_save_channels_first(self, channels_first):
@@ -444,7 +444,7 @@ def test_save_tensor_preserve(self, dtype):
444444
@skipIfNoExec("sox")
445445
@skipIfNoFFmpeg
446446
class TestSaveNonExistingDirectory(PytorchTestCase):
447-
_save = partial(get_save_func(), backend="ffmpeg")
447+
_save = staticmethod(partial(get_save_func(), backend="ffmpeg"))
448448

449449
def test_save_fail(self):
450450
"""

0 commit comments

Comments
 (0)