Unverified Commit a109f856 authored by ptrblck's avatar ptrblck Committed by GitHub
Browse files

use reshape instead of view (#971)

parent 4a1fa2c4
......@@ -527,7 +527,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment