Protect cuda better ?

This commit is contained in:
Nicolas Patry 2024-05-06 20:32:08 +02:00
parent 3494cb0067
commit fe4ef95d92

View File

@ -29,7 +29,7 @@ if torch.version.hip is not None:
empty_cache = torch.cuda.empty_cache empty_cache = torch.cuda.empty_cache
synchronize = torch.cuda.synchronize synchronize = torch.cuda.synchronize
get_free_memory = get_cuda_free_memory get_free_memory = get_cuda_free_memory
elif torch.version.cuda is not None: elif torch.version.cuda is not None and torch.cuda.is_available():
SYSTEM = "cuda" SYSTEM = "cuda"
empty_cache = torch.cuda.empty_cache empty_cache = torch.cuda.empty_cache
synchronize = torch.cuda.synchronize synchronize = torch.cuda.synchronize