I designed a model that has two different kinds of inputs: x1 and x2. x2 will only pass through part of the model and its output is used for some constraints. I saved the model after training and try to reuse it in the test stage. However, I only need input x1 during the test stage. Is there any way that I can load the layer parameters of the saved model but with different contents in the “forward” function? It seems that torch.load(model.state_dict) cannot give me satisfying results since it requires the same forward function.
Thanks very much!