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 331d939 commit 202d542Copy full SHA for 202d542
torchao/quantization/quant_primitives.py
@@ -4,6 +4,7 @@
4
# This source code is licensed under the license found in the
5
# LICENSE file in the root directory of this source tree.
6
7
+import math
8
from typing import Optional, Tuple
9
10
import torch
@@ -118,7 +119,6 @@ def dynamically_quantize_per_tensor(
118
119
# reference: https://fburl.com/code/srbiybme
120
min_val_neg = torch.min(min_val, torch.zeros_like(min_val))
121
max_val_pos = torch.max(max_val, torch.zeros_like(max_val))
- device = min_val_neg.device
122
123
scale = (max_val_pos - min_val_neg) / float(quant_max - quant_min)
124
# TODO(future): make torch.clamp with scalar work on cpu-half
0 commit comments