Skip to content

Commit

Permalink
Make disable_tf32 context manager handle exceptions (#7651)
Browse files Browse the repository at this point in the history
  • Loading branch information
malfet authored Jun 2, 2023
1 parent f3d6c6b commit a5035df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
def disable_tf32():
previous = torch.backends.cudnn.allow_tf32
torch.backends.cudnn.allow_tf32 = False
yield
torch.backends.cudnn.allow_tf32 = previous
try:
yield
finally:
torch.backends.cudnn.allow_tf32 = previous


def list_model_fns(module):
Expand Down

0 comments on commit a5035df

Please sign in to comment.