Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sdkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from threading import local

from torch.cuda import is_available as cuda_available
from logging import getLogger

class Context(local):
def __init__(self) -> None:
self._device: str = "cuda:0"

self._device: str = 'cuda:0'
if not cuda_available():
getLogger('sdkit').warning("CUDA device not found, fallback to cpu device.")
self._device: str = 'cpu'

self._half_precision: bool = True
self._vram_usage_level = None

Expand Down