class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(5, 5)
        self.linear2 = nn.Linear(5, 5)
        self.linear3 = nn.Linear(5, 5)
        
    def forward(self, x):
        x1 = self.linear1(x)
        print(x.size())
        
        x2 = self.linear2(x1)
        print(x.size())
        
        x3 = self.linear3(x2)
        # Fuse output from linear1 with output of linear3
        x = torch.cat((x1, x3), 0)
        print(x.size())
        return x
model = Model()
x = torch.rand(2, 5)
output = model(x)

torch.Size([2, 5])
torch.Size([2, 5])
torch.Size([4, 5])