Skip to content

Commit 163627c

Browse files
authored
Update static_quantization_tutorial.py
1 parent 40f8027 commit 163627c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

advanced_source/static_quantization_tutorial.py

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

264264
res = []
265265
for k in topk:
266-
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
266+
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
267267
res.append(correct_k.mul_(100.0 / batch_size))
268268
return res
269269

0 commit comments

Comments
 (0)