Unverified Commit cae1e6d4 authored by lin bin's avatar lin bin Committed by GitHub
Browse files

[Model Compression] fix data contiguous bug in amc example (#4049)

parent c0385c57
......@@ -49,7 +49,7 @@ def accuracy(output, target, topk=(1, 5)):
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0)
correct_k = correct[:k].contiguous().view(-1).float().sum(0)
res.append(correct_k.mul_(100.0 / batch_size))
return res + appendices
......
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