(saved_dict: Dict[str, Any])
| 138 | |
| 139 | |
| 140 | def get_state_dict(saved_dict: Dict[str, Any]) -> Dict[str, Any]: |
| 141 | state_dict = saved_dict |
| 142 | if "model" in saved_dict.keys(): |
| 143 | state_dict = state_dict["model"] |
| 144 | if "module" in saved_dict.keys(): |
| 145 | state_dict = state_dict["module"] |
| 146 | if "state_dict" in saved_dict.keys(): |
| 147 | state_dict = state_dict["state_dict"] |
| 148 | return state_dict |
| 149 | |
| 150 | |
| 151 | def update_state_dict_inplace(state_dict: Dict[str, Any], old_key: str, new_key: str) -> Dict[str, Any]: |
no outgoing calls
no test coverage detected