Skip to content

Commit 038b72c

Browse files
authored
Update graph_mode_static_quantization_tutorial.py
1 parent 1c1f40d commit 038b72c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prototype_source/graph_mode_static_quantization_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def accuracy(output, target, topk=(1,)):
137137

138138
res = []
139139
for k in topk:
140-
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
140+
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
141141
res.append(correct_k.mul_(100.0 / batch_size))
142142
return res
143143

0 commit comments

Comments
 (0)