MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / all_reduce_tensor

Function all_reduce_tensor

utils/pyt_utils.py:125–130  ·  view source on GitHub ↗
(tensor, op=dist.ReduceOp.SUM, world_size=1)

Source from the content-addressed store, hash-verified

123
124
125def all_reduce_tensor(tensor, op=dist.ReduceOp.SUM, world_size=1):
126 tensor = tensor.clone()
127 dist.all_reduce(tensor, op)
128 tensor.div_(world_size)
129
130 return tensor
131
132
133def load_restore_model(model, model_file):

Callers 1

train.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected