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
af8d3b97
"vscode:/vscode.git/clone" did not exist on "8b7cb1f50a9c64547008a362006a9353294237a1"
Unverified
Commit
af8d3b97
authored
Jul 29, 2021
by
yangarbiter
Committed by
GitHub
Jul 29, 2021
Browse files
Rename infer method to forward for WaveRNNInferenceWrapper (#1650)
parent
47ccabbf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
examples/pipeline_wavernn/inference.py
examples/pipeline_wavernn/inference.py
+8
-8
examples/pipeline_wavernn/wavernn_inference_wrapper.py
examples/pipeline_wavernn/wavernn_inference_wrapper.py
+7
-8
No files found.
examples/pipeline_wavernn/inference.py
View file @
af8d3b97
...
@@ -73,13 +73,13 @@ def main(args):
...
@@ -73,13 +73,13 @@ def main(args):
mel_specgram
=
transforms
(
waveform
)
mel_specgram
=
transforms
(
waveform
)
wavernn_model
=
wavernn
(
args
.
checkpoint_name
).
eval
().
to
(
device
)
wavernn_model
=
wavernn
(
args
.
checkpoint_name
).
eval
().
to
(
device
)
wavernn_model
=
WaveRNNInferenceWrapper
(
wavernn_model
)
wavernn_
inference_
model
=
WaveRNNInferenceWrapper
(
wavernn_model
)
if
args
.
jit
:
if
args
.
jit
:
wavernn_model
=
torch
.
jit
.
script
(
wavernn_model
)
wavernn_
inference_
model
=
torch
.
jit
.
script
(
wavernn_
inference_
model
)
with
torch
.
no_grad
():
with
torch
.
no_grad
():
output
=
wavernn_
model
.
infer
(
mel_specgram
.
to
(
device
),
output
=
wavernn_
inference_model
(
mel_specgram
.
to
(
device
),
loss_name
=
args
.
loss
,
loss_name
=
args
.
loss
,
mulaw
=
(
not
args
.
no_mulaw
),
mulaw
=
(
not
args
.
no_mulaw
),
batched
=
(
not
args
.
no_batch_inference
),
batched
=
(
not
args
.
no_batch_inference
),
...
...
examples/pipeline_wavernn/wavernn_inference_wrapper.py
View file @
af8d3b97
...
@@ -160,8 +160,7 @@ class WaveRNNInferenceWrapper(torch.nn.Module):
...
@@ -160,8 +160,7 @@ class WaveRNNInferenceWrapper(torch.nn.Module):
f
"Valid choices are 'both', 'before' and 'after'."
)
f
"Valid choices are 'both', 'before' and 'after'."
)
return
padded
return
padded
@
torch
.
jit
.
export
def
forward
(
self
,
def
infer
(
self
,
specgram
:
Tensor
,
specgram
:
Tensor
,
loss_name
:
str
=
"crossentropy"
,
loss_name
:
str
=
"crossentropy"
,
mulaw
:
bool
=
True
,
mulaw
:
bool
=
True
,
...
...
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