MCPcopy Create free account
hub / github.com/DingXiaoH/RepVGG / reduce_tensor

Function reduce_tensor

utils.py:228–232  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

226
227
228def reduce_tensor(tensor):
229 rt = tensor.clone()
230 dist.all_reduce(rt, op=dist.ReduceOp.SUM)
231 rt /= dist.get_world_size()
232 return rt
233
234def update_model_ema(cfg, num_gpus, model, model_ema, cur_epoch, cur_iter):
235 """Update exponential moving average (ema) of model weights."""

Callers 1

validateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected