(state_dict)
| 9 | |
| 10 | |
| 11 | def copyStateDict(state_dict): |
| 12 | if list(state_dict.keys())[0].startswith("module"): |
| 13 | start_idx = 1 |
| 14 | else: |
| 15 | start_idx = 0 |
| 16 | new_state_dict = OrderedDict() |
| 17 | for k, v in state_dict.items(): |
| 18 | name = ".".join(k.split(".")[start_idx:]) |
| 19 | new_state_dict[name] = v |
| 20 | return new_state_dict |
| 21 | |
| 22 | |
| 23 | def saveInput( |