cxzhou95 / XLSR

PyTorch implementation of paper "Extremely Lightweight Quantization Robust Real-Time Single-Image Super Resolution for Mobile Devices"
MIT License
56 stars 9 forks source link

Typo in Gblock #8

Closed deepernewbie closed 2 years ago

deepernewbie commented 2 years ago

There is an issue in the

class Gblock(nn.Module):
    def __init__(self, in_channels, out_channels, groups):
        super(Gblock, self).__init__()
        self.conv0 = nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1, groups=groups)
        self.relu = nn.ReLU(inplace=True)
        self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=1, padding=0)

    def forward(self, x):
        x = self.conv0(x)
        x = self.relu(x)
        x = self.conv1(x)
        return x

the line self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=1, padding=0)

should be replaced with

self.conv1 = nn.Conv2d(out_channels, out_channels, kernel_size=1, padding=0)

for a general purpose Gblock since in_channels and out_channels does not need to be the same