Skip to content

Commit b7b5a37

Browse files
committed
rename variable
1 parent 5e37177 commit b7b5a37

File tree

1 file changed

+5
-5
lines changed
  • segmentation_models_pytorch/decoders/upernet

1 file changed

+5
-5
lines changed

segmentation_models_pytorch/decoders/upernet/decoder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def __init__(
3636
)
3737

3838
def forward(self, x):
39-
_, _, h, w = x.shape
39+
_, _, height, weight = x.shape
4040
out = [x] + [
41-
F.interpolate(block(x), size=(h, w), mode="bilinear", align_corners=False)
41+
F.interpolate(block(x), size=(height, weight), mode="bilinear", align_corners=False)
4242
for block in self.blocks
4343
]
4444
out = self.out_conv(torch.cat(out, dim=1))
@@ -60,9 +60,9 @@ def __init__(self, skip_channels, pyramid_channels, use_bathcnorm=True):
6060
)
6161

6262
def forward(self, x, skip):
63-
_, ch, h, w = skip.shape
64-
x = F.interpolate(x, size=(h, w), mode="bilinear", align_corners=False)
65-
if ch != 0:
63+
_, channels, height, weight = skip.shape
64+
x = F.interpolate(x, size=(height, weight), mode="bilinear", align_corners=False)
65+
if channels != 0:
6666
skip = self.skip_conv(skip)
6767
x = x + skip
6868
return x

0 commit comments

Comments
 (0)