[diffusion] Clean code (#19325)
This commit is contained in:
@@ -90,9 +90,9 @@ def _torch_cleanup() -> None:
|
||||
try:
|
||||
import torch
|
||||
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.synchronize()
|
||||
torch.cuda.empty_cache()
|
||||
if torch.get_device_module().is_available():
|
||||
torch.get_device_module().synchronize()
|
||||
torch.get_device_module().empty_cache()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user