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
FAST-RNNT
Commits
77125678
Commit
77125678
authored
Dec 01, 2021
by
Daniel Povey
Browse files
Add more test
parent
2c3a7e1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
torch_mutual_information/rnnt_test.py
torch_mutual_information/rnnt_test.py
+7
-0
No files found.
torch_mutual_information/rnnt_test.py
View file @
77125678
...
@@ -40,8 +40,15 @@ def test_rnnt_logprobs_basic():
...
@@ -40,8 +40,15 @@ def test_rnnt_logprobs_basic():
m2
=
rnnt_loss_simple
(
lm
,
am
,
symbols
,
termination_symbol
,
None
)
m2
=
rnnt_loss_simple
(
lm
,
am
,
symbols
,
termination_symbol
,
None
)
print
(
"m2 = "
,
m2
)
print
(
"m2 = "
,
m2
)
device
=
torch
.
device
(
'cuda'
)
m3
=
rnnt_loss_simple
(
lm
.
to
(
device
),
am
.
to
(
device
),
symbols
.
to
(
device
),
termination_symbol
,
None
)
print
(
"m3 = "
,
m2
)
assert
torch
.
allclose
(
m
,
m2
)
assert
torch
.
allclose
(
m
,
m2
)
assert
torch
.
allclose
(
m
,
m3
.
to
(
'cpu'
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
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