MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / reduce_tensor

Function reduce_tensor

classification/utils.py:344–348  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

342
343
344def reduce_tensor(tensor):
345 rt = tensor.clone()
346 dist.all_reduce(rt, op=dist.ReduceOp.SUM)
347 rt /= dist.get_world_size()
348 return rt
349
350
351# https://github.com/facebookresearch/ConvNeXt/blob/main/utils.py

Callers 3

eval_epochFunction · 0.90
validate_realFunction · 0.90
validateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected