[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
8b8980a607
commit
d8b785a4e2
2 changed files with 8 additions and 18 deletions
|
|
@ -1052,7 +1052,9 @@ def _drain_cuda_cache() -> None:
|
|||
mps_backend = getattr(getattr(torch, "backends", None), "mps", None)
|
||||
if mps_backend is not None and mps_backend.is_available():
|
||||
mps_module = getattr(torch, "mps", None)
|
||||
empty_cache = getattr(mps_module, "empty_cache", None) if mps_module else None
|
||||
empty_cache = (
|
||||
getattr(mps_module, "empty_cache", None) if mps_module else None
|
||||
)
|
||||
if empty_cache is not None:
|
||||
empty_cache()
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue