class RTCNN(nn.Module):
def init(self, args):
super(RTCNN, self).init()
    self.args = args
    self.scale_idx = 0

    scale = args.scale[0]
    
    self.conv1 = nn.Conv2d(3, 32, kernel_size=(3,3), stride=(1,1), padding=1, bias=False)
    self.DW_conv1 = DepthwiseConv2d(32, depth_multiplier=1, kernel_size=(1,5))
    self.PW_conv1 = nn.Conv2d(32, 16, kernel_size=(1,1), stride=(1,1), padding=1, bias=False)
    self.DW_conv2 = DepthwiseConv2d(16, depth_multiplier=1, kernel_size=(1,5))
    self.PW_conv2 = nn.Conv2d(16, 32, kernel_size=(1,1), stride=(1,1), padding=1, bias=False)
    # self.add1 = nn.Sequential(nn.Conv2d(3,32,3,1,1), nn.Conv2d(16,32,1,1,1))
    # self.add1 = torch.add(self.conv1, self.PW_conv2)
    self.DW_conv3 = DepthwiseConv2d(32, depth_multiplier=1, kernel_size=(3,3))
    self.PW_conv3 = nn.Conv2d(32, 16, kernel_size=(1,1), stride=(1,1), padding=1, bias=False)
    self.DW_conv4 = DepthwiseConv2d(16, depth_multiplier=1, kernel_size=(3,3))
    self.PW_conv4 = nn.Conv2d(16, 4, kernel_size=(1,1), stride=(1,1), padding=1, bias=False)
    # self.pixel_shuffle = LambdaLayer(lambda x:space_to_depth(x,2))
    # self.Yc = LambdaLayer(self.PW_conv4)
    # self.Yn = nn.Upsample(scale_factor=2, mode='nearest')
    # self.Y = nn.Sequential(self.Yc, self.Yn)
    ## position to weight
    self.P2W = Pos2Weight(inC=64)

def repeat_x(self, x):
    scale_int = math.ceil(self.scale)
    N, C, H, W = x.size()
    x = x.view(N, C, H, 1, W, 1)

    x = torch.cat([x] * scale_int, 3)
    x = torch.cat([x] * scale_int, 5).permute(0, 3, 5, 1, 2, 4)

    return x.contiguous().view(-1, C, H, W)


def forward(self, x, pos_mat):
    # x = F.relu(self.conv1(x))
    conv1 = self.conv1(x)
    relu1 = F.relu(conv1)
    DW_conv1 = self.DW_conv1(relu1)
    PW_conv1 = self.PW_conv1(DW_conv1)
    relu2 = F.relu(PW_conv1)
    DW_conv2 = self.DW_conv2(relu2)
    PW_conv2 = self. PW_conv2(DW_conv2)
    add1 = torch.cat((conv1, PW_conv2), dim=2)
    residual = F.relu(add1)
    relu3 = F.relu(residual)
    DW_conv3 = self.DW_conv3(relu3)
    PW_conv3 = self.PW_conv3(DW_conv3)
    relu4 = F.relu(PW_conv3)
    DW_conv4 = self.DW_conv4(relu4)
    PW_conv4 = self.PW_conv4(DW_conv4)

    local_weight = self.P2W(pos_mat.view(pos_mat.size(1),-1)) 
    up_x = self.repeat_x(PW_conv4 )     ### the output is (N*r*r,inC,inH,inW)
  
  
    # N*r^2 x [inC * kH * kW] x [inH * inW]
    cols = nn.functional.unfold(up_x, 3,padding=1)
    scale_int = math.ceil(self.scale)
    cols = cols.contiguous().view(cols.size(0)//(scale_int**2),scale_int**2, cols.size(1), cols.size(2), 1).permute(0,1, 3, 4, 2).contiguous()
    local_weight = local_weight.contiguous().view(x.size(2),scale_int, x.size(3),scale_int,-1,3).permute(1,3,0,2,4,5).contiguous()
    local_weight = local_weight.contiguous().view(scale_int**2, x.size(2)*x.size(3),-1, 3)
    out = torch.matmul(cols,local_weight).permute(0,1,4,2,3)
    out = out.contiguous().view(x.size(0),scale_int,scale_int,3,x.size(2),x.size(3)).permute(0,3,4,1,5,2)
    out = out.contiguous().view(x.size(0),3, scale_int*x.size(2),scale_int*x.size(3))
    out = self.add_mean(out)
    return out

File “C:\Users\DIC\Meta-SR-Pytorch\model\metartcnn.py”, line 117, in forward
output = PW_conv4.reshape(2,64,50,50)
RuntimeError: shape ‘[2, 64, 50, 50]’ is invalid for input of size 48384
Really need help to figure out where did I do wrong.