Beispiel #1
0
 def extract_states(sources: Architecture) -> Checkpoint:
     targets = {}
     for name, source in sources.items():
         targets[name] = source.state_dict()
     return targets
Beispiel #2
0
 def load_states(sources: Checkpoint, targets: Architecture) -> None:
     for name, target in targets.items():
         target.load_state_dict(sources[name])