"src/vscode:/vscode.git/clone" did not exist on "4f4cad7edfc894907d7e47c43c9d8875a03d5845"
Commit d62875cc authored by John Reese's avatar John Reese Committed by Facebook GitHub Bot
Browse files

[codemod][usort] apply import merging for fbcode (8 of 11)

Summary:
Applies new import merging and sorting from µsort v1.0.

When merging imports, µsort will make a best-effort to move associated
comments to match merged elements, but there are known limitations due to
the diynamic nature of Python and developer tooling. These changes should
not produce any dangerous runtime changes, but may require touch-ups to
satisfy linters and other tooling.

Note that µsort uses case-insensitive, lexicographical sorting, which
results in a different ordering compared to isort. This provides a more
consistent sorting order, matching the case-insensitive order used when
sorting import statements by module name, and ensures that "frog", "FROG",
and "Frog" always sort next to each other.

For details on µsort's sorting and merging semantics, see the user guide:
https://usort.readthedocs.io/en/stable/guide.html#sorting

Reviewed By: lisroach

Differential Revision: D36402214

fbshipit-source-id: b641bfa9d46242188524d4ae2c44998922a62b4c
parent 44f4a5ea
......@@ -8,7 +8,7 @@ from typing import Callable, List, Tuple
import torch
import torchaudio
from torchaudio._internal import module_utils
from torchaudio.models import RNNT, RNNTBeamSearch, emformer_rnnt_base
from torchaudio.models import emformer_rnnt_base, RNNT, RNNTBeamSearch
__all__ = []
......
import itertools as it
import warnings
from collections import namedtuple
from typing import Dict, List, Optional, Union, NamedTuple
from typing import Dict, List, NamedTuple, Optional, Union
import torch
from torchaudio._torchaudio_decoder import (
_create_word_dict,
_CriterionType,
_LM,
_Dictionary,
_KenLM,
_LexiconDecoder,
_LexiconFreeDecoder,
_LexiconDecoderOptions,
_LexiconFreeDecoder,
_LexiconFreeDecoderOptions,
_LM,
_load_words,
_SmearingMode,
_Trie,
_Dictionary,
_create_word_dict,
_load_words,
_ZeroLM,
)
from torchaudio.utils import download_asset
......
......@@ -2,7 +2,11 @@ import math
from typing import List, Optional, Tuple
import torch
from torchaudio.models.emformer import _EmformerAttention, _EmformerImpl, _get_weight_init_gains
from torchaudio.models.emformer import (
_EmformerAttention,
_EmformerImpl,
_get_weight_init_gains,
)
def _get_activation_module(activation: str) -> torch.nn.Module:
......
from torchaudio._internal import module_utils as _mod_utils
from .sox_effects import (
apply_effects_file,
apply_effects_tensor,
effect_names,
init_sox_effects,
shutdown_sox_effects,
effect_names,
apply_effects_tensor,
apply_effects_file,
)
......
import os
from typing import List, Tuple, Optional
from typing import List, Optional, Tuple
import torch
import torchaudio
......
from ._multi_channel import MVDR, PSD, RTFMVDR, SoudenMVDR
from ._transforms import (
Spectrogram,
InverseSpectrogram,
GriffinLim,
AmplitudeToDB,
MelScale,
ComputeDeltas,
Fade,
FrequencyMasking,
GriffinLim,
InverseMelScale,
InverseSpectrogram,
LFCC,
MelScale,
MelSpectrogram,
MFCC,
LFCC,
MuLawEncoding,
MuLawDecoding,
MuLawEncoding,
PitchShift,
Resample,
TimeStretch,
Fade,
FrequencyMasking,
TimeMasking,
RNNTLoss,
SlidingWindowCmn,
Vad,
SpectralCentroid,
Spectrogram,
TimeMasking,
TimeStretch,
Vad,
Vol,
ComputeDeltas,
PitchShift,
RNNTLoss,
)
......
......@@ -7,7 +7,10 @@ from typing import Callable, Optional
import torch
from torch import Tensor
from torchaudio import functional as F
from torchaudio.functional.functional import _apply_sinc_resample_kernel, _get_sinc_resample_kernel
from torchaudio.functional.functional import (
_apply_sinc_resample_kernel,
_get_sinc_resample_kernel,
)
__all__ = []
......
from torchaudio._internal import module_utils as _mod_utils
from . import (
sox_utils,
)
from . import sox_utils
from .download import download_asset
if _mod_utils.is_sox_available():
......
from typing import List, Dict
from typing import Dict, List
import torch
from torchaudio._internal import module_utils as _mod_utils
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment