Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
l-bat committed Jun 7, 2024
1 parent bbf53ce commit 39b2f7e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def calculate_integer_quantization_params(
level_high = 2 ** (num_bits - 1) - 1
scale = fns.max(fns.abs(weight), axis=reduction_axes, keepdims=True) # [a1, r//gs, 1, a2]
scale = scale / level_high
zero_point = fns.zeros_like(scale).astype(TensorDataType.int32)
zero_point = fns.as_tensor_like(scale, [0]).astype(TensorDataType.int32)
eps = fns.finfo(scale).eps
# NOTE: adding machine epsilon to avoid division by zero
scale = fns.where(fns.abs(scale) < eps, eps, scale)
Expand Down

0 comments on commit 39b2f7e

Please sign in to comment.