Hi,
I’m trying to concatenate two layers as below.
class Net1(nn.Module):
    def __init__(self, num_classes=2):
        super(Net1, self).__init__()

        self.conv1 = nn.Conv2d(in_channels=3, out_channels=10, kernel_size=3, stride=1, padding=1)
        self.relu1 = nn.ReLU()

        self.conv2 = nn.Conv2d(in_channels=10, out_channels=10, kernel_size=3, stride=1, padding=1)
        self.relu2 = nn.ReLU()

        self.pool = nn.MaxPool2d(kernel_size=2)

        self.conv3 = nn.Conv2d(in_channels=10, out_channels=10, kernel_size=3, stride=1, padding=1)
        self.relu3 = nn.ReLU()

        self.conv4 = nn.Conv2d(in_channels=10, out_channels=10, kernel_size=3, stride=1, padding=1)
        self.relu4 = nn.ReLU()

        self.fc = nn.Linear(in_features=112 * 112 * 10, out_features=num_classes)

    def forward(self, input):
        output1 = self.conv1(input)
        output2 = self.relu1(output1)

        output3 = self.conv2(output2)
        output4 = self.relu2(output3)

        output5 = self.pool(output4)

        output6 = self.conv3(output5)
        output7 = self.relu3(output6)

        output8 = self.conv4(output7)
        output9 = self.relu4(output8)
        
        #output = torch.cat((self.conv4(output),self.conv3(output)), 1)
        output10 = torch.cat((output9,output7), 1)

        #output10 = output9.view(-1, 112 * 112 * 10)
        output11 = output10.view(-1, 112 * 112 * 10)

        output12 = self.fc(output11)

        return output12


net1 = Net1()
print(net1)

But I got this error after adding torch.cat layer
ValueError: Expected input batch_size (8) to match target batch_size (4).