Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
768432c3
Unverified
Commit
768432c3
authored
Sep 02, 2021
by
Caroline Chen
Committed by
GitHub
Sep 02, 2021
Browse files
Standardize optional types in docstrings (#1746)
parent
d9bfb708
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
torchaudio/transforms.py
torchaudio/transforms.py
+10
-10
No files found.
torchaudio/transforms.py
View file @
768432c3
...
@@ -194,7 +194,7 @@ class InverseSpectrogram(torch.nn.Module):
...
@@ -194,7 +194,7 @@ class InverseSpectrogram(torch.nn.Module):
r
"""
r
"""
Args:
Args:
spectrogram (Tensor): Complex tensor of audio of dimension (..., freq, time).
spectrogram (Tensor): Complex tensor of audio of dimension (..., freq, time).
length (int, optional): The output length of the waveform.
length (int
or None
, optional): The output length of the waveform.
Returns:
Returns:
Tensor: Dimension (..., time), Least squares estimation of the original signal.
Tensor: Dimension (..., time), Least squares estimation of the original signal.
...
@@ -297,8 +297,8 @@ class AmplitudeToDB(torch.nn.Module):
...
@@ -297,8 +297,8 @@ class AmplitudeToDB(torch.nn.Module):
Args:
Args:
stype (str, optional): scale of input tensor ('power' or 'magnitude'). The
stype (str, optional): scale of input tensor ('power' or 'magnitude'). The
power being the elementwise square of the magnitude. (Default: ``'power'``)
power being the elementwise square of the magnitude. (Default: ``'power'``)
top_db (float, optional): minimum negative cut-off in decibels. A reasonable
number
top_db (float
or None
, optional): minimum negative cut-off in decibels. A reasonable
is 80. (Default: ``None``)
number
is 80. (Default: ``None``)
"""
"""
__constants__
=
[
'multiplier'
,
'amin'
,
'ref_value'
,
'db_multiplier'
]
__constants__
=
[
'multiplier'
,
'amin'
,
'ref_value'
,
'db_multiplier'
]
...
@@ -340,7 +340,7 @@ class MelScale(torch.nn.Module):
...
@@ -340,7 +340,7 @@ class MelScale(torch.nn.Module):
f_max (float or None, optional): Maximum frequency. (Default: ``sample_rate // 2``)
f_max (float or None, optional): Maximum frequency. (Default: ``sample_rate // 2``)
n_stft (int, optional): Number of bins in STFT. See ``n_fft`` in :class:`Spectrogram`. (Default: ``201``)
n_stft (int, optional): Number of bins in STFT. See ``n_fft`` in :class:`Spectrogram`. (Default: ``201``)
norm (str or None, optional): If 'slaney', divide the triangular mel weights by the width of the mel band
norm (str or None, optional): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``)
(area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
"""
"""
__constants__
=
[
'n_mels'
,
'sample_rate'
,
'f_min'
,
'f_max'
]
__constants__
=
[
'n_mels'
,
'sample_rate'
,
'f_min'
,
'f_max'
]
...
@@ -399,7 +399,7 @@ class InverseMelScale(torch.nn.Module):
...
@@ -399,7 +399,7 @@ class InverseMelScale(torch.nn.Module):
tolerance_loss (float, optional): Value of loss to stop optimization at. (Default: ``1e-5``)
tolerance_loss (float, optional): Value of loss to stop optimization at. (Default: ``1e-5``)
tolerance_change (float, optional): Difference in losses to stop optimization at. (Default: ``1e-8``)
tolerance_change (float, optional): Difference in losses to stop optimization at. (Default: ``1e-8``)
sgdargs (dict or None, optional): Arguments for the SGD optimizer. (Default: ``None``)
sgdargs (dict or None, optional): Arguments for the SGD optimizer. (Default: ``None``)
norm (
O
ptional
[str]
): If 'slaney', divide the triangular mel weights by the width of the mel band
norm (
str or None, o
ptional): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``)
(area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
"""
"""
...
@@ -511,7 +511,7 @@ class MelSpectrogram(torch.nn.Module):
...
@@ -511,7 +511,7 @@ class MelSpectrogram(torch.nn.Module):
:attr:`center` is ``True``. (Default: ``"reflect"``)
:attr:`center` is ``True``. (Default: ``"reflect"``)
onesided (bool, optional): controls whether to return half of results to
onesided (bool, optional): controls whether to return half of results to
avoid redundancy. (Default: ``True``)
avoid redundancy. (Default: ``True``)
norm (
O
ptional
[str]
): If 'slaney', divide the triangular mel weights by the width of the mel band
norm (
str or None, o
ptional): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``)
(area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
...
@@ -821,7 +821,7 @@ class Resample(torch.nn.Module):
...
@@ -821,7 +821,7 @@ class Resample(torch.nn.Module):
but less efficient. (Default: ``6``)
but less efficient. (Default: ``6``)
rolloff (float, optional): The roll-off frequency of the filter, as a fraction of the Nyquist.
rolloff (float, optional): The roll-off frequency of the filter, as a fraction of the Nyquist.
Lower values reduce anti-aliasing, but also reduce some of the highest frequencies. (Default: ``0.99``)
Lower values reduce anti-aliasing, but also reduce some of the highest frequencies. (Default: ``0.99``)
beta (float or None): The shape parameter used for kaiser window.
beta (float or None
, optional
): The shape parameter used for kaiser window.
dtype (torch.device, optional):
dtype (torch.device, optional):
Determnines the precision that resampling kernel is pre-computed and cached. If not provided,
Determnines the precision that resampling kernel is pre-computed and cached. If not provided,
kernel is computed with ``torch.float64`` then cached as ``torch.float32``.
kernel is computed with ``torch.float64`` then cached as ``torch.float32``.
...
@@ -921,8 +921,8 @@ class ComputeDeltas(torch.nn.Module):
...
@@ -921,8 +921,8 @@ class ComputeDeltas(torch.nn.Module):
See `torchaudio.functional.compute_deltas` for more details.
See `torchaudio.functional.compute_deltas` for more details.
Args:
Args:
win_length (int): The window length used for computing delta. (Default: ``5``)
win_length (int
, optional
): The window length used for computing delta. (Default: ``5``)
mode (str): Mode parameter passed to padding. (Default: ``'replicate'``)
mode (str
, optional
): Mode parameter passed to padding. (Default: ``'replicate'``)
"""
"""
__constants__
=
[
'win_length'
]
__constants__
=
[
'win_length'
]
...
@@ -1244,7 +1244,7 @@ class Vad(torch.nn.Module):
...
@@ -1244,7 +1244,7 @@ class Vad(torch.nn.Module):
the detection algorithm (e.g. 0, 0.5, ...). (Default: 1.35)
the detection algorithm (e.g. 0, 0.5, ...). (Default: 1.35)
measure_freq (float, optional) Frequency of the algorithm’s
measure_freq (float, optional) Frequency of the algorithm’s
processing/measurements. (Default: 20.0)
processing/measurements. (Default: 20.0)
measure_duration: (float, optional) Measurement duration.
measure_duration: (float
or None
, optional) Measurement duration.
(Default: Twice the measurement period; i.e. with overlap.)
(Default: Twice the measurement period; i.e. with overlap.)
measure_smooth_time (float, optional) Time constant used to smooth
measure_smooth_time (float, optional) Time constant used to smooth
spectral measurements. (Default: 0.4)
spectral measurements. (Default: 0.4)
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment