Skip to content

Commit 9a50365

Browse files
committed
Remove dropping_support
1 parent 126a2b0 commit 9a50365

File tree

8 files changed

+5
-59
lines changed

8 files changed

+5
-59
lines changed

src/torchaudio/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from torchaudio._internal.module_utils import dropping_io_support, dropping_class_io_support
21
from typing import Union, BinaryIO, Optional, Tuple
32
import os
43
import torch

src/torchaudio/_internal/module_utils.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -101,48 +101,6 @@ def decorator(func):
101101

102102
return decorator
103103

104-
DEPRECATION_MSG = (
105-
"This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. "
106-
"Please see https://github.com/pytorch/audio/issues/3902 for more information."
107-
)
108-
109-
IO_DEPRECATION_MSG = (
110-
"This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. "
111-
"The decoding and encoding capabilities of PyTorch for both audio and video are being consolidated into TorchCodec. "
112-
"Please see https://github.com/pytorch/audio/issues/3902 for more information."
113-
)
114-
115-
dropping_support = deprecated(DEPRECATION_MSG, version="2.9", remove=True)
116-
117-
def dropping_class_support(c, msg=DEPRECATION_MSG):
118-
c.__init__ = wrap_deprecated(c.__init__, f"{c.__module__}.{c.__name__}", msg, version="2.9", remove=True)
119-
c.__doc__ = f"""DEPRECATED
120-
121-
.. warning::
122-
123-
This class is deprecated from version 2.8. It will be removed in the 2.9 release.
124-
{msg}
125-
{c.__doc__}
126-
"""
127-
128-
UNSUPPORTED.append(c)
129-
return c
130-
131-
def dropping_const_support(c, msg=DEPRECATION_MSG, name=None):
132-
c.__doc__ = f"""[DEPRECATED]
133-
134-
.. warning::
135-
136-
This object is deprecated deprecated from version 2.8. It will be removed in the 2.9 release.
137-
{msg}
138-
{c.__doc__}
139-
"""
140-
return c
141-
142-
dropping_class_io_support = partial(dropping_class_support, msg=IO_DEPRECATION_MSG)
143-
144-
dropping_io_support = deprecated(IO_DEPRECATION_MSG, version="2.9", remove=True)
145-
146104
def fail_with_message(message):
147105
"""Generate decorator to give users message about missing TorchAudio extension."""
148106

src/torchaudio/functional/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from torchaudio._internal.module_utils import dropping_support
21

3-
from ._alignment import forced_align as _forced_align, merge_tokens, TokenSpan
2+
from ._alignment import forced_align, merge_tokens, TokenSpan
43
from .filtering import (
54
allpass_biquad,
65
band_biquad,
@@ -26,8 +25,6 @@
2625
vad,
2726
)
2827

29-
forced_align = dropping_support(_forced_align)
30-
3128
from .functional import (
3229
add_noise,
3330
amplitude_to_DB,

src/torchaudio/functional/functional.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ def backward(ctx, dy):
17791779
result = grad * grad_out;
17801780
return (result, None, None, None, None, None, None, None)
17811781

1782-
def _rnnt_loss(
1782+
def rnnt_loss(
17831783
logits: Tensor,
17841784
targets: Tensor,
17851785
logit_lengths: Tensor,
@@ -1883,9 +1883,6 @@ def psd(
18831883
psd = psd.sum(dim=-3)
18841884
return psd
18851885

1886-
# Expose both deprecated wrapper as well as original because torchscript breaks on
1887-
# wrapped functions.
1888-
rnnt_loss = dropping_support(_rnnt_loss)
18891886

18901887
def _compute_mat_trace(input: torch.Tensor, dim1: int = -1, dim2: int = -2) -> torch.Tensor:
18911888
r"""Compute the trace of a Tensor along ``dim1`` and ``dim2`` dimensions.

src/torchaudio/transforms/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from torchaudio._internal.module_utils import dropping_class_support
21
from ._multi_channel import MVDR, PSD, RTFMVDR, SoudenMVDR
32
from ._transforms import (
43
AddNoise,
@@ -22,7 +21,7 @@
2221
PitchShift,
2322
Preemphasis,
2423
Resample,
25-
RNNTLoss as _RNNTLoss,
24+
RNNTLoss,
2625
SlidingWindowCmn,
2726
SpecAugment,
2827
SpectralCentroid,
@@ -35,8 +34,6 @@
3534
Vol,
3635
)
3736

38-
RNNTLoss = dropping_class_support(_RNNTLoss)
39-
4037
__all__ = [
4138
"AddNoise",
4239
"AmplitudeToDB",

src/torchaudio/utils/download.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def _get_hash(path, hash, chunk_size=1028):
3030
data = file.read(chunk_size)
3131
return m.hexdigest()
3232

33-
from torchaudio._internal.module_utils import dropping_support
34-
3533
def _download_asset(
3634
key: str,
3735
hash: str = "",

test/torchaudio_unittest/common_utils/func_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def torch_script(obj):
88
buffer = io.BytesIO()
99
if hasattr(obj, '__wrapped__'):
1010
# This is hack for those functions which are deprecated with decorators
11-
# like @deprecated or @dropping_support. Adding the decorators breaks
11+
# like @deprecated. Adding the decorators breaks
1212
# TorchScript. We need to unwrap the function to get the original one,
1313
# which make the tests pass, but that's a lie: the public (deprecated)
1414
# function doesn't support torchscript anymore

test/torchaudio_unittest/functional/torchscript_consistency_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ def func(tensor):
804804
logit_lengths = torch.tensor([2], device=tensor.device, dtype=torch.int32)
805805
target_lengths = torch.tensor([2], device=tensor.device, dtype=torch.int32)
806806
# This is hack for those functions which are deprecated with decorators
807-
# like @deprecated or @dropping_support. Adding the decorators breaks
807+
# like @deprecated. Adding the decorators breaks
808808
# TorchScript. So here we use the private function which make the tests
809809
# pass, but that's a lie: the public (deprecated) function doesn't
810810
# support torchscript anymore

0 commit comments

Comments
 (0)