(saved_dict: Dict[str, Any])
| 119 | |
| 120 | |
| 121 | def get_state_dict(saved_dict: Dict[str, Any]) -> Dict[str, Any]: |
| 122 | state_dict = saved_dict |
| 123 | if "model" in saved_dict.keys(): |
| 124 | state_dict = state_dict["model"] |
| 125 | if "module" in saved_dict.keys(): |
| 126 | state_dict = state_dict["module"] |
| 127 | if "state_dict" in saved_dict.keys(): |
| 128 | state_dict = state_dict["state_dict"] |
| 129 | return state_dict |
| 130 | |
| 131 | |
| 132 | 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