We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 554cb60 commit 0db5fc2Copy full SHA for 0db5fc2
torchao/quantization/quant_primitives.py
@@ -948,7 +948,9 @@ def _choose_qparams_affine(
948
scale = torch.clamp(scale, min=eps)
949
else:
950
assert mapping_type == MappingType.ASYMMETRIC.name
951
- scale = (max_val_pos - min_val_neg) / float(quant_max - quant_min)
+ scale = (max_val_pos - min_val_neg) / torch.tensor(
952
+ [float(quant_max - quant_min)], dtype=input.dtype, device=input.device
953
+ )
954
955
if zero_point_domain == ZeroPointDomain.NONE.name:
956
zero_point = None
0 commit comments