The number of input features for self.classifier is defined by the sum of the output features of both “pre-ensemble” models.
As you can see, ModelA and ModelB both output 2 values (from self.fc1). These features will be concatenated in MyEnsemble and passed to self.classifier, which takes 4 input features.