Skip to content

Commit

Permalink
fix import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jianan-gu committed Feb 8, 2024
1 parent 8b4baaa commit 0905ad7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bitsandbytes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

if COMPILED_WITH_CUDA:
from .optim import adam

from .backends import register_backend, backends
from .backends.cuda import CUDABackend
register_backend("cuda", CUDABackend())
__pdoc__ = {
"libbitsandbytes": False,
"optim.optimizer.Optimizer8bit": False,
Expand Down
5 changes: 0 additions & 5 deletions bitsandbytes/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from typing import Dict
import torch

from bitsandbytes.cextension import COMPILED_WITH_CUDA
from bitsandbytes.backends.base import Backend

backends: Dict[str, Backend] = {}

def register_backend(backend_name: str, backend_instance: Backend):
backends[backend_name.lower()] = backend_instance

if COMPILED_WITH_CUDA:
from .cuda import CUDABackend
register_backend("cuda", CUDABackend())

0 comments on commit 0905ad7

Please sign in to comment.