MCPcopy Create free account
hub / github.com/SwinTransformer/Transformer-SSL / reduce_tensor

Function reduce_tensor

utils.py:110–114  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

108
109
110def reduce_tensor(tensor):
111 rt = tensor.clone()
112 dist.all_reduce(rt, op=dist.ReduceOp.SUM)
113 rt /= dist.get_world_size()
114 return rt

Callers 2

validateFunction · 0.90
validateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected