You don’t need to retrain the models, but could just redefine the forward of modelA and load it’s state_dict.
The state_dict contains only the parameters of the model, so you are free to manipulate the actual forward method as you wish, since the computation graph is created dynamically.