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
d1825985
Commit
d1825985
authored
Dec 14, 2019
by
Charles J.Y. Yoon
Committed by
Vincent QB
Dec 13, 2019
Browse files
Simpler amplitude_to_DB (#367)
* Simpler amplitude_to_DB * flake8
parent
9ab5dd71
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
torchaudio/functional.py
torchaudio/functional.py
+1
-4
No files found.
torchaudio/functional.py
View file @
d1825985
...
@@ -293,10 +293,7 @@ def amplitude_to_DB(x, multiplier, amin, db_multiplier, top_db=None):
...
@@ -293,10 +293,7 @@ def amplitude_to_DB(x, multiplier, amin, db_multiplier, top_db=None):
x_db
-=
multiplier
*
db_multiplier
x_db
-=
multiplier
*
db_multiplier
if
top_db
is
not
None
:
if
top_db
is
not
None
:
new_x_db_max
=
torch
.
tensor
(
x_db
=
x_db
.
clamp
(
min
=
x_db
.
max
().
item
()
-
top_db
)
float
(
x_db
.
max
())
-
top_db
,
dtype
=
x_db
.
dtype
,
device
=
x_db
.
device
)
x_db
=
torch
.
max
(
x_db
,
new_x_db_max
)
return
x_db
return
x_db
...
...
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