MCPcopy Create free account
hub / github.com/VisionRush/DeepFakeDefenders / reduce_tensor

Function reduce_tensor

core/mengine.py:18–22  ·  view source on GitHub ↗
(tensor, n)

Source from the content-addressed store, hash-verified

16
17
18def reduce_tensor(tensor, n):
19 rt = tensor.clone()
20 dist.all_reduce(rt, op=dist.ReduceOp.SUM)
21 rt /= n
22 return rt
23
24
25def gather_tensor(tensor, n):

Callers 3

train_multi_classMethod · 0.85
val_multi_classMethod · 0.85
val_emaMethod · 0.85

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected