Skip to content

Commit

Permalink
reshape
Browse files Browse the repository at this point in the history
  • Loading branch information
richzhang authored Sep 29, 2021
1 parent d4bf038 commit b27a34a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def accuracy(output, target, topk=(1,)):

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

Expand Down

0 comments on commit b27a34a

Please sign in to comment.