MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / all_sum

Function all_sum

tensorflow/python/ops/nccl_ops.py:33–47  ·  view source on GitHub ↗

Returns a list of tensors with the all-reduce sum across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. Args: tensors: The input tensors across which to sum; must be assigned to

(tensors)

Source from the content-addressed store, hash-verified

31
32
33def all_sum(tensors):
34 """Returns a list of tensors with the all-reduce sum across `tensors`.
35
36 The computation is done with an all-reduce operation, so if only some of the
37 returned tensors are evaluated then the computation will hang.
38
39 Args:
40 tensors: The input tensors across which to sum; must be assigned
41 to GPU devices.
42
43 Returns:
44 List of tensors, each with the sum of the input tensors, where tensor i has
45 the same device as `tensors[i]`.
46 """
47 return _apply_all_reduce('sum', tensors)
48
49
50@ops.RegisterGradient('NcclAllReduce')

Callers

nothing calls this directly

Calls 1

_apply_all_reduceFunction · 0.85

Tested by

no test coverage detected