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
658e3a88
Unverified
Commit
658e3a88
authored
Jul 28, 2021
by
Arijit Roy
Committed by
GitHub
Jul 28, 2021
Browse files
Add example code for Resample (#1644)
parent
d1d6dbc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
torchaudio/transforms.py
torchaudio/transforms.py
+5
-0
No files found.
torchaudio/transforms.py
View file @
658e3a88
...
@@ -643,6 +643,11 @@ class Resample(torch.nn.Module):
...
@@ -643,6 +643,11 @@ class Resample(torch.nn.Module):
cached as ``torch.float64``. If you use resample with lower precision, then instead of providing this
cached as ``torch.float64``. If you use resample with lower precision, then instead of providing this
providing this argument, please use ``Resample.to(dtype)``, so that the kernel generation is still
providing this argument, please use ``Resample.to(dtype)``, so that the kernel generation is still
carried out on ``torch.float64``.
carried out on ``torch.float64``.
Example
>>> waveform, sample_rate = torchaudio.load('test.wav', normalize=True)
>>> transform = transforms.Resample(sample_rate, sample_rate/10)
>>> waveform = transform(waveform)
"""
"""
def
__init__
(
def
__init__
(
...
...
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