Skip to content

Commit 3548dc5

Browse files
committed
remove incorrect line change; make generic
1 parent 30ad305 commit 3548dc5

File tree

1 file changed

+2
-7
lines changed
  • src/compressed_tensors/quantization/utils

1 file changed

+2
-7
lines changed

src/compressed_tensors/quantization/utils/helpers.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def compute_dynamic_scales_and_zp(
167167

168168
keep_dims = True
169169
if args.strategy == QuantizationStrategy.TOKEN:
170-
dim = {0, 1, 2}
170+
dim = {1, 2}
171171
reduce_dims = tuple(idx for idx in range(value.ndim) if idx not in dim)
172172
elif args.strategy == QuantizationStrategy.TENSOR:
173173
reduce_dims = None
@@ -176,13 +176,8 @@ def compute_dynamic_scales_and_zp(
176176
QuantizationStrategy.GROUP,
177177
):
178178

179-
if len(value.shape) > 2:
180-
dim = {0, 1, 2}
181-
else:
182-
dim = {0, 1}
183-
184179
reduce_dims = tuple(
185-
idx for idx in range(len(value.shape) + 1) if idx not in dim
180+
idx for idx in range(len(value.shape) + 1) if idx not in range(value.dim())
186181
)
187182
keep_dims = False
188183

0 commit comments

Comments
 (0)