Skip to content

Commit 0a0b531

Browse files
committed
removed optional data=None in from_prequantized
1 parent 7a117e4 commit 0a0b531

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

bitsandbytes/nn/modules.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ def __new__(cls, data=None, requires_grad=True, quant_state=None, blocksize=64,
154154
return self
155155

156156
@classmethod
157-
def from_prequantized(cls, quantized_stats, data=None, requires_grad=False, device='cuda', **kwargs):
158-
if data is None:
159-
weight_key = [k for k in quantized_stats if k.endswith(".weight")][0]
160-
data = quantized_stats.pop(weight_key)
157+
def from_prequantized(cls, data, quantized_stats, requires_grad=False, device='cuda', **kwargs):
161158
self = torch.Tensor._make_subclass(cls, data.to(device))
162159
self.requires_grad = requires_grad
163160
self.quant_state = QuantState.from_dict(qs_dict=quantized_stats, device=device)

0 commit comments

Comments
 (0)