Skip to content

Commit d66340c

Browse files
committed
fix: Fixed qint_bounds zero_point == 0 for perCh
Signed-off-by: Brandon Groth <[email protected]>
1 parent d141bcd commit d66340c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fms_mo/quant_refactor/linear_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def qint_bounds(
6363
[torch.IntTensor, torch.IntTensor, torch.dtype]: qint_bounds and torch.qint_dtype
6464
"""
6565
# Set quantization bounds and datatype based on zero_point
66-
if symmetric and zero_point == 0:
66+
if symmetric and torch.sum(zero_point) == 0:
6767
qlevel_symmetric = torch.tensor(1) if qlevel_lowering else torch.tensor(0)
6868
qlevel_min, qlevel_max = (
6969
-(2 ** (num_bits - 1)) + qlevel_symmetric,

0 commit comments

Comments
 (0)