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
a5035df5
Unverified
Commit
a5035df5
authored
Jun 02, 2023
by
Nikita Shulga
Committed by
GitHub
Jun 02, 2023
Browse files
Make `disable_tf32` context manager handle exceptions (#7651)
parent
f3d6c6be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
test/test_models.py
test/test_models.py
+4
-2
No files found.
test/test_models.py
View file @
a5035df5
...
@@ -29,7 +29,9 @@ SKIP_BIG_MODEL = os.getenv("SKIP_BIG_MODEL", "1") == "1"
...
@@ -29,7 +29,9 @@ SKIP_BIG_MODEL = os.getenv("SKIP_BIG_MODEL", "1") == "1"
def
disable_tf32
():
def
disable_tf32
():
previous
=
torch
.
backends
.
cudnn
.
allow_tf32
previous
=
torch
.
backends
.
cudnn
.
allow_tf32
torch
.
backends
.
cudnn
.
allow_tf32
=
False
torch
.
backends
.
cudnn
.
allow_tf32
=
False
try
:
yield
yield
finally
:
torch
.
backends
.
cudnn
.
allow_tf32
=
previous
torch
.
backends
.
cudnn
.
allow_tf32
=
previous
...
...
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