MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / reduce_tensor

Function reduce_tensor

timm/utils/distributed.py:11–15  ·  view source on GitHub ↗
(tensor, n)

Source from the content-addressed store, hash-verified

9
10
11def reduce_tensor(tensor, n):
12 rt = tensor.clone()
13 dist.all_reduce(rt, op=dist.ReduceOp.SUM)
14 rt /= n
15 return rt
16
17
18def distribute_bn(model, world_size, reduce=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected