Is there any advantage to using “load_state_dict” not “deepcopy” or vice versa when one wants to ‘deep’ copy, i.e. updating model_B doesn’t change model_A after copy, one model to another?
class DummyNet(nn.Module):
def __init__(self,..):
super(dummyNet, self).__init__()
...
def forward(...)
...
Does copy.deepcopy(model_A) copies the state variables as well, like in model_B.load_state_dict(model_A.state_dict())? If so, in what situations is one preferred over another for deep copy?