MCPcopy
hub / github.com/DingXiaoH/RepVGG / unwrap_model

Function unwrap_model

utils.py:116–119  ·  view source on GitHub ↗

Remove the DistributedDataParallel wrapper if present.

(model)

Source from the content-addressed store, hash-verified

114 amp = None
115
116def unwrap_model(model):
117 """Remove the DistributedDataParallel wrapper if present."""
118 wrapped = isinstance(model, torch.nn.parallel.distributed.DistributedDataParallel)
119 return model.module if wrapped else model
120
121
122def load_checkpoint(config, model, optimizer, lr_scheduler, logger, model_ema=None):

Callers 6

mainFunction · 0.90
load_checkpointFunction · 0.85
load_weightsFunction · 0.85
save_latestFunction · 0.85
save_checkpointFunction · 0.85
update_model_emaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected