Seeing that what is returned is an OrderedDict (at least in 0.4.0) you can’t just call .clone() on the dict but would either have to do it for each layer:
{k : v.clone() for k, v in net.state_dict().items()} or use deep copy.deepcopy.