One of the linear layers (self.fc3, self.fc4, or self.fc5) raises the shape mismatch error, so you would need to make sure the feature dimension of the input activation matches the in_features of the corresponding linear layer. My best guess is that concat_input's feature dim doesn’t fir into self.fc3.