Skip to content

Commit 202d542

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Fix missing math import and remove an unused variable (#59)
Summary: As titled Pull Request resolved: #59 Reviewed By: mcr229 Differential Revision: D54931361 Pulled By: digantdesai fbshipit-source-id: 85ee6a90aa5591d815597150ae57fa78148edf27
1 parent 331d939 commit 202d542

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchao/quantization/quant_primitives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This source code is licensed under the license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
import math
78
from typing import Optional, Tuple
89

910
import torch
@@ -118,7 +119,6 @@ def dynamically_quantize_per_tensor(
118119
# reference: https://fburl.com/code/srbiybme
119120
min_val_neg = torch.min(min_val, torch.zeros_like(min_val))
120121
max_val_pos = torch.max(max_val, torch.zeros_like(max_val))
121-
device = min_val_neg.device
122122

123123
scale = (max_val_pos - min_val_neg) / float(quant_max - quant_min)
124124
# TODO(future): make torch.clamp with scalar work on cpu-half

0 commit comments

Comments
 (0)