mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-07 05:02:43 +08:00
13 lines
278 B
Python
13 lines
278 B
Python
def is_cuda_available() -> bool:
|
|
try:
|
|
import torch
|
|
return torch.cuda.is_available()
|
|
except ImportError:
|
|
return False
|
|
def is_torch_installed() -> bool:
|
|
try:
|
|
import torch
|
|
return True
|
|
except ImportError:
|
|
return False
|