I don’t completely understand the use case and the current code snippet seems to try to pass modules to the forward method of the linear layers?
Could you explain your use case a bit more and how these connections should look like?
If you want to pass the output of one layer to specific others (to create the “connections”), you should be able to do so:
def forward(self, x):
    x = self.A(x)
    xb = self.B(x)
    xc = self.C(x)
    ...