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
1e23d214
Commit
1e23d214
authored
May 20, 2019
by
Jason Lian
Browse files
Apply feedback
parent
2870d248
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
torchaudio/functional.py
torchaudio/functional.py
+1
-1
torchaudio/transforms.py
torchaudio/transforms.py
+2
-2
No files found.
torchaudio/functional.py
View file @
1e23d214
...
...
@@ -323,7 +323,7 @@ def mu_law_encoding(x, qc):
mu
=
torch
.
tensor
(
mu
,
dtype
=
x
.
dtype
)
x_mu
=
torch
.
sign
(
x
)
*
torch
.
log1p
(
mu
*
torch
.
abs
(
x
))
/
torch
.
log1p
(
mu
)
x_mu
=
((
x_mu
+
1
)
/
2
*
mu
+
0.5
).
long
(
)
x_mu
=
((
x_mu
+
1
)
/
2
*
mu
+
0.5
).
to
(
torch
.
int64
)
return
x_mu
...
...
torchaudio/transforms.py
View file @
1e23d214
...
...
@@ -434,10 +434,10 @@ class MuLawExpanding(object):
"""
Args:
x_mu (
FloatTensor/Long
Tensor)
x_mu (Tensor)
Returns:
x (
Float
Tensor)
x (Tensor)
"""
return
F
.
mu_law_expanding
(
x_mu
,
self
.
qc
)
...
...
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