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
20469cfe
Unverified
Commit
20469cfe
authored
Apr 07, 2021
by
Chin-Yun Yu
Committed by
GitHub
Apr 06, 2021
Browse files
Revert "Refactor implementation of F.compute_deltas (#1423)" (#1432)
This reverts commit
8d2eeb11
.
parent
f21d1683
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchaudio/functional/functional.py
torchaudio/functional/functional.py
+3
-3
No files found.
torchaudio/functional/functional.py
View file @
20469cfe
...
...
@@ -793,7 +793,7 @@ def compute_deltas(
# pack batch
shape
=
specgram
.
size
()
specgram
=
specgram
.
reshape
(
-
1
,
1
,
shape
[
-
1
])
specgram
=
specgram
.
reshape
(
1
,
-
1
,
shape
[
-
1
])
assert
win_length
>=
3
...
...
@@ -804,9 +804,9 @@ def compute_deltas(
specgram
=
torch
.
nn
.
functional
.
pad
(
specgram
,
(
n
,
n
),
mode
=
mode
)
kernel
=
torch
.
arange
(
-
n
,
n
+
1
,
1
,
device
=
device
,
dtype
=
dtype
).
view
(
1
,
1
,
-
1
)
kernel
=
torch
.
arange
(
-
n
,
n
+
1
,
1
,
device
=
device
,
dtype
=
dtype
).
repeat
(
specgram
.
shape
[
1
]
,
1
,
1
)
output
=
torch
.
nn
.
functional
.
conv1d
(
specgram
,
kernel
)
/
denom
output
=
torch
.
nn
.
functional
.
conv1d
(
specgram
,
kernel
,
groups
=
specgram
.
shape
[
1
]
)
/
denom
# unpack batch
output
=
output
.
reshape
(
shape
)
...
...
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