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
vision
Commits
16f07667
"...text-generation-inference.git" did not exist on "ce960be0a518262093f6038f10b4e2110da242d3"
Unverified
Commit
16f07667
authored
Nov 22, 2021
by
Philip Meier
Committed by
GitHub
Nov 22, 2021
Browse files
remove custom code for model output comparison (#4971)
parent
bae1d7e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
test/test_models.py
test/test_models.py
+1
-8
No files found.
test/test_models.py
View file @
16f07667
...
...
@@ -133,14 +133,7 @@ def _check_jit_scriptable(nn_module, args, unwrapper=None, skip=False):
with
freeze_rng_state
():
results_from_imported
=
m_import
(
*
args
)
tol
=
3e-4
try
:
torch
.
testing
.
assert_close
(
results
,
results_from_imported
,
atol
=
tol
,
rtol
=
tol
)
except
ValueError
:
# custom check for the models that return named tuples:
# we compare field by field while ignoring None as assert_close can't handle None
for
a
,
b
in
zip
(
results
,
results_from_imported
):
if
a
is
not
None
:
torch
.
testing
.
assert_close
(
a
,
b
,
atol
=
tol
,
rtol
=
tol
)
torch
.
testing
.
assert_close
(
results
,
results_from_imported
,
atol
=
tol
,
rtol
=
tol
)
TEST_WITH_SLOW
=
os
.
getenv
(
"PYTORCH_TEST_WITH_SLOW"
,
"0"
)
==
"1"
if
not
TEST_WITH_SLOW
or
skip
:
...
...
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