MCPcopy Create free account
hub / github.com/Physical-Intelligence/openpi / get_model_parameters

Function get_model_parameters

scripts/train_pytorch.py:140–146  ·  view source on GitHub ↗

Get parameters from model, handling DDP wrapper.

(model)

Source from the content-addressed store, hash-verified

138
139
140def get_model_parameters(model):
141 """Get parameters from model, handling DDP wrapper."""
142 return (
143 model.module.parameters()
144 if isinstance(model, torch.nn.parallel.DistributedDataParallel)
145 else model.parameters()
146 )
147
148
149def save_checkpoint(model, optimizer, global_step, config, is_main, data_config):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected