(state_dict, prefix)
| 130 | |
| 131 | |
| 132 | def remove_prefix_from_state_dict(state_dict, prefix): |
| 133 | for old_key in list(state_dict.keys()): |
| 134 | if old_key.startswith(prefix): |
| 135 | new_key = remove_prefix_string(old_key, prefix) |
| 136 | state_dict[new_key] = state_dict.pop(old_key) |
| 137 | |
| 138 | |
| 139 | def load_state(path, model, ignore=[], optimizer=None, cuda=False, recover=False, |
no test coverage detected