"...en/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "cd7071e7506275a1c7c52df9e1a696feafa3b118"
Unverified Commit a5035df5 authored by Nikita Shulga's avatar Nikita Shulga Committed by GitHub
Browse files

Make `disable_tf32` context manager handle exceptions (#7651)

parent f3d6c6be
......@@ -29,8 +29,10 @@ SKIP_BIG_MODEL = os.getenv("SKIP_BIG_MODEL", "1") == "1"
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment