Skip to content

Commit a3def3e

Browse files
committed
Fix ruff B008 (function call in arguments)
1 parent 4d11f96 commit a3def3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bitsandbytes/functional.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ def get_instance(cls):
164164
dtype2bytes[torch.uint8] = 1
165165
dtype2bytes[torch.int8] = 1
166166

167-
def get_paged(*shape, dtype=torch.float32, device=torch.device('cuda', index=0)):
167+
FIRST_CUDA_DEVICE = torch.device('cuda', index=0)
168+
169+
def get_paged(*shape, dtype=torch.float32, device=FIRST_CUDA_DEVICE):
168170
num_bytes = dtype2bytes[dtype]*prod(shape)
169171
cuda_ptr = lib.cget_managed_ptr(ct.c_size_t(num_bytes))
170172
c_ptr = ct.cast(cuda_ptr, ct.POINTER(ct.c_int))

0 commit comments

Comments
 (0)