Skip to content

Commit 1acb897

Browse files
committed
Fix wrong scale eps applied
1 parent 2a3fbff commit 1acb897

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchao/dtypes/affine_quantized_tensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def from_hp_to_floatx(
357357
target_dtype=target_dtype,
358358
quant_min=math.ceil(torch.finfo(target_dtype).min),
359359
quant_max=math.ceil(torch.finfo(target_dtype).max),
360-
eps=torch.finfo(torch.float32).eps,
360+
eps=torch.finfo(target_dtype).tiny,
361361
scale_dtype=scale_dtype,
362362
zero_point_dtype=None,
363363
preserve_zero=True,

0 commit comments

Comments
 (0)