class MyEnsemble(nn.Module):
    def __init__(self, modelA, modelB):
        super(MyEnsemble, self).__init__()
        self.modelA = modelA
        self.modelB = modelB
        # Remove last linear layer
        self.modelA.fc = nn.Identity()
        self.modelB.fc = nn.Identity()
        
        # Create new classifier
       # self.classifier = nn.Linear(2048+512, nb_classes)
        
    def forward(self, x):
        x1 = self.modelA(x.clone())  # clone to make sure x is not changed by inplace methods
        x1 = x1.view(x1.size(0), -1)
        x2 = self.modelB(x)
        x2 = x2.view(x2.size(0), -1)
        x = torch.cat((x1, x2), dim=1)
        
     #   x = self.classifier(F.relu(x))
        return x

# Create models and load state_dicts    
modelA= mode1()
# Load state dicts
PATH1 = 'model1.pth'
modelA.load_state_dict(torch.load(PATH1))
modelB = torch.hub.load("model2")
model = MyEnsemble(modelA, modelB)

but got
TypeError: forward() takes 2 positional arguments but 3 were given