From 9f2e0a130e2f17c73ba8f1ef3801180b2a92e344 Mon Sep 17 00:00:00 2001 From: andreABbauer <62743847+andreABbauer@users.noreply.github.com> Date: Thu, 7 May 2020 15:28:28 +0200 Subject: [PATCH] variable naming matches paper and comment The c in the code was not referring to the c in the comment. The code c was referenced as k in the comments. --- lib/models/seg_hrnet_ocr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/seg_hrnet_ocr.py b/lib/models/seg_hrnet_ocr.py index ed9df629..7869729b 100644 --- a/lib/models/seg_hrnet_ocr.py +++ b/lib/models/seg_hrnet_ocr.py @@ -56,8 +56,8 @@ def __init__(self, cls_num=0, scale=1): self.scale = scale def forward(self, feats, probs): - batch_size, c, h, w = probs.size(0), probs.size(1), probs.size(2), probs.size(3) - probs = probs.view(batch_size, c, -1) + batch_size, k, h, w = probs.size(0), probs.size(1), probs.size(2), probs.size(3) + probs = probs.view(batch_size, k, -1) feats = feats.view(batch_size, feats.size(1), -1) feats = feats.permute(0, 2, 1) # batch x hw x c probs = F.softmax(self.scale * probs, dim=2)# batch x k x hw