From 189108479593e73b89685c1cad17565e701d3f36 Mon Sep 17 00:00:00 2001 From: Ritesh Botcha <63497179+riteshsadwik06@users.noreply.github.com> Date: Tue, 24 Aug 2021 16:22:41 +0530 Subject: [PATCH] Update eval.py --- utils/eval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/eval.py b/utils/eval.py index 5051350..5b84c88 100644 --- a/utils/eval.py +++ b/utils/eval.py @@ -13,6 +13,6 @@ def accuracy(output, target, topk=(1,)): res = [] for k in topk: - correct_k = correct[:k].view(-1).float().sum(0) + correct_k = correct[:k].reshape(-1).float().sum(0) res.append(correct_k.mul_(100.0 / batch_size)) - return res \ No newline at end of file + return res