Skip to content

Commit 316daf7

Browse files
authored
Typos in deprecation message (#1256)
1 parent 7aac931 commit 316daf7

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ Conventions
195195

196196
With torchaudio being a machine learning library and built on top of PyTorch,
197197
torchaudio is standardized around the following naming conventions. Tensors are
198-
assumed to have channels as the first dimension and time as the last
198+
assumed to have "channel" as the first dimension and time as the last
199199
dimension (when applicable). This makes it consistent with PyTorch's dimensions.
200200
For size names, the prefix `n_` is used (e.g. "a tensor of size (`n_freq`, `n_mel`)")
201201
whereas dimension names do not have this prefix (e.g. "a tensor of
202-
dimension (channels, time)")
202+
dimension (channel, time)")
203203

204-
* `waveform`: a tensor of audio samples with dimensions (channels, time)
204+
* `waveform`: a tensor of audio samples with dimensions (channel, time)
205205
* `sample_rate`: the rate of audio dimensions (samples per second)
206-
* `specgram`: a tensor of spectrogram with dimensions (channels, freq, time)
207-
* `mel_specgram`: a mel spectrogram with dimensions (channels, mel, time)
206+
* `specgram`: a tensor of spectrogram with dimensions (channel, freq, time)
207+
* `mel_specgram`: a mel spectrogram with dimensions (channel, mel, time)
208208
* `hop_length`: the number of samples between the starts of consecutive frames
209209
* `n_fft`: the number of Fourier bins
210210
* `n_mel`, `n_mfcc`: the number of mel and MFCC bins
@@ -216,16 +216,16 @@ dimension (channels, time)")
216216

217217
Transforms expect and return the following dimensions.
218218

219-
* `Spectrogram`: (channels, time) -> (channels, freq, time)
220-
* `AmplitudeToDB`: (channels, freq, time) -> (channels, freq, time)
221-
* `MelScale`: (channels, freq, time) -> (channels, mel, time)
222-
* `MelSpectrogram`: (channels, time) -> (channels, mel, time)
223-
* `MFCC`: (channels, time) -> (channel, mfcc, time)
224-
* `MuLawEncode`: (channels, time) -> (channels, time)
225-
* `MuLawDecode`: (channels, time) -> (channels, time)
226-
* `Resample`: (channels, time) -> (channels, time)
227-
* `Fade`: (channels, time) -> (channels, time)
228-
* `Vol`: (channels, time) -> (channels, time)
219+
* `Spectrogram`: (channel, time) -> (channel, freq, time)
220+
* `AmplitudeToDB`: (channel, freq, time) -> (channel, freq, time)
221+
* `MelScale`: (channel, freq, time) -> (channel, mel, time)
222+
* `MelSpectrogram`: (channel, time) -> (channel, mel, time)
223+
* `MFCC`: (channel, time) -> (channel, mfcc, time)
224+
* `MuLawEncode`: (channel, time) -> (channel, time)
225+
* `MuLawDecode`: (channel, time) -> (channel, time)
226+
* `Resample`: (channel, time) -> (channel, time)
227+
* `Fade`: (channel, time) -> (channel, time)
228+
* `Vol`: (channel, time) -> (channel, time)
229229

230230
Complex numbers are supported via tensors of dimension (..., 2), and torchaudio provides `complex_norm` and `angle` to convert such a tensor into its magnitude and phase. Here, and in the documentation, we use an ellipsis "..." as a placeholder for the rest of the dimensions of a tensor, e.g. optional batching and channel dimensions.
231231

torchaudio/backend/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def set_audio_backend(backend: Optional[str]):
4444
"""
4545
if torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE is not None:
4646
warnings.warn(
47-
'"torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE" flag is depredated and will be removed in 0.9.0. '
47+
'"torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE" flag is deprecated and will be removed in 0.9.0. '
4848
'Please remove the use of flag.'
4949
)
5050

@@ -57,7 +57,7 @@ def set_audio_backend(backend: Optional[str]):
5757
module = no_backend
5858
elif backend == 'sox':
5959
warnings.warn(
60-
'"sox" backend is depredated and will be removed in 0.9.0. '
60+
'"sox" backend is deprecated and will be removed in 0.9.0. '
6161
'Please use "sox_io" backend.'
6262
)
6363
module = sox_backend
@@ -66,7 +66,7 @@ def set_audio_backend(backend: Optional[str]):
6666
elif backend == 'soundfile':
6767
if torchaudio.USE_SOUNDFILE_LEGACY_INTERFACE:
6868
warnings.warn(
69-
'The legacy interface of "soundfile" backend is depredated and will be removed in 0.9.0. '
69+
'The legacy interface of "soundfile" backend is deprecated and will be removed in 0.9.0. '
7070
'Please migrate to the new interface.'
7171
)
7272
module = soundfile_backend

torchaudio/compliance/kaldi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def _get_sinc_resample_kernel(orig_freq: int, new_freq: int, lowpass_filter_widt
793793
t = t.clamp_(-lowpass_filter_width, lowpass_filter_width)
794794
t *= math.pi
795795
# we do not use torch.hann_window here as we need to evaluate the window
796-
# at spectifics positions, not over a regular grid.
796+
# at specific positions, not over a regular grid.
797797
window = torch.cos(t / lowpass_filter_width / 2)**2
798798
kernel = torch.where(t == 0, torch.tensor(1.).to(t), torch.sin(t) / t)
799799
kernel.mul_(window)

torchaudio/kaldi_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def read_vec_int_ark(file_or_fd: Any) -> Iterable[Tuple[str, Tensor]]:
5757
>>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_int_ark(file) }
5858
"""
5959
# Requires convert_contiguous to be True because elements from int32 vector are
60-
# sored in tuples: (sizeof(int32), value) so strides are (5,) instead of (4,) which will throw an error
60+
# sorted in tuples: (sizeof(int32), value) so strides are (5,) instead of (4,) which will throw an error
6161
# in from_numpy as it expects strides to be a multiple of 4 (int32).
6262
return _convert_method_output_to_tensor(file_or_fd, kaldi_io.read_vec_int_ark, convert_contiguous=True)
6363

torchaudio/transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self,
7171
super(Spectrogram, self).__init__()
7272
self.n_fft = n_fft
7373
# number of FFT bins. the returned STFT result will have n_fft // 2 + 1
74-
# number of frequecies due to onesided=True in torch.stft
74+
# number of frequencies due to onesided=True in torch.stft
7575
self.win_length = win_length if win_length is not None else n_fft
7676
self.hop_length = hop_length if hop_length is not None else self.win_length // 2
7777
window = window_fn(self.win_length) if wkwargs is None else window_fn(self.win_length, **wkwargs)
@@ -547,8 +547,8 @@ def forward(self, waveform: Tensor) -> Tensor:
547547
else:
548548
mel_specgram = self.amplitude_to_DB(mel_specgram)
549549

550-
# (..., channel, n_mels, time).tranpose(...) dot (n_mels, n_mfcc)
551-
# -> (..., channel, time, n_mfcc).tranpose(...)
550+
# (..., channel, n_mels, time).transpose(...) dot (n_mels, n_mfcc)
551+
# -> (..., channel, time, n_mfcc).transpose(...)
552552
mfcc = torch.matmul(mel_specgram.transpose(-2, -1), self.dct_mat).transpose(-2, -1)
553553
return mfcc
554554

0 commit comments

Comments
 (0)