Skip to content

Commit b70a09c

Browse files
committed
skip for old pytorch versions
1 parent 1414628 commit b70a09c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bitsandbytes/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
if torch.cuda.is_available():
3535
from .backends.cuda import ops as cuda_ops
3636

37-
if torch.xpu.is_available():
38-
from .backends.xpu import ops as xpu_ops
37+
# xpu was introduced in PyTorch 2.3
38+
if torch.__version__ >= (2, 3):
39+
if torch.xpu.is_available():
40+
from .backends.xpu import ops as xpu_ops
3941

4042

4143
def _import_backends():

0 commit comments

Comments
 (0)