Skip to content

Commit

Permalink
lintrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfucn committed Oct 30, 2023
1 parent 80eab05 commit 3fb8ea0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ def quantize_blockwise_4bits_ref(matrix_float: npt.ArrayLike, block_size: int, i
block_idx = k_id // block_size
scales[n, block_idx] = scale
zp_pair = zero_point[n, block_idx // 2]
zero_point[n, block_idx // 2] = ((zp_pair & 0x0F) | (zp << 4)) \
if (block_idx & 1) else ((zp_pair & 0xF0) | zp)
zero_point[n, block_idx // 2] = (
((zp_pair & 0x0F) | (zp << 4)) if (block_idx & 1) else ((zp_pair & 0xF0) | zp)
)

blk_int0 = np.clip(
np.round(np.float32(matrix_float_padded[n, k_id : k_id + block_size : 2] * reciprocal_scale + zp)),
Expand Down

0 comments on commit 3fb8ea0

Please sign in to comment.