Skip to content

Commit ac9523b

Browse files
committed
Fix in imagenet accuracy function
1 parent 3d400a5 commit ac9523b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/imagenet/main.py

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

435435
res = []
436436
for k in topk:
437-
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
437+
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
438438
res.append(correct_k.mul_(100.0 / batch_size))
439439
return res
440440

0 commit comments

Comments
 (0)