Skip to content

Commit b859c2f

Browse files
committed
fix bias per channel quantization bug
1 parent 31a856d commit b859c2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pquant/core/torch/quantizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def compute_data_dynamic_bits(self, x):
9191
return self.calculate_bits_from_abs(abs_x)
9292

9393
def compute_weight_dynamic_bits(self, x):
94-
if self.granularity == "per_tensor":
94+
if self.granularity == "per_tensor" or x.ndim == 1:
9595
_, i, f = self.get_quantization_bits()
9696
return i, f
9797
if self.granularity == "per_channel":

0 commit comments

Comments
 (0)