| 59 | |
| 60 | |
| 61 | class HackParameterList(nn.ParameterList): |
| 62 | def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs): |
| 63 | for i in range(len(self)): |
| 64 | if prefix + str(i) in state_dict: |
| 65 | self[i].data.copy_(state_dict[prefix+str(i)]) |
| 66 | |
| 67 | map_cls = { |
| 68 | nn.Linear: (HackLinear, {}), |