Loading partial models with shared parameters


Let’s say I have two models, A and B that share 50% of their parameters. If Model A is already in GPU and I want to load Model B, is there a way to load only the parameters that are not shared with A? I’m trying to cut the load time of model B. It seems like just initializing the model will randomly assign weights, so the time to load will not reduce even if I can filter the state_dict.