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