Skip to content

Commit 2354bdd

Browse files
authored
fix meta device dispatch (#1564)
Signed-off-by: jiqing-feng <[email protected]>
1 parent 0cd87aa commit 2354bdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitsandbytes/nn/modules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def to(self: T, tensor: Tensor, non_blocking: bool = ...) -> T: ...
695695
def to(self, *args, **kwargs):
696696
device, dtype, non_blocking, convert_to_format = torch._C._nn._parse_to(*args, **kwargs)
697697

698-
if device is not None:
698+
if device in ("cuda", "xpu", "cpu"):
699699
if device.type == "cuda" and self.data.device.type == "cpu":
700700
return self.cuda(device)
701701
elif device.type == "cpu":

0 commit comments

Comments
 (0)