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

Function _apply_reduce

tensorflow/python/ops/nccl_ops.py:239–251  ·  view source on GitHub ↗

Helper function for reduce_* functions.

(reduction, tensors)

Source from the content-addressed store, hash-verified

237
238
239def _apply_reduce(reduction, tensors):
240 """Helper function for reduce_* functions."""
241 if not tensors:
242 raise ValueError('Must pass >0 tensors to reduce operations')
243
244 for t in tensors:
245 _check_device(t)
246 result = gen_nccl_ops.nccl_reduce(input=tensors, reduction=reduction)
247 try:
248 next(t for t in tensors if t.device == result.device)
249 except StopIteration:
250 raise ValueError('One input tensor must be assigned to current device')
251 return result
252
253
254def _get_shared_name():

Callers 1

reduce_sumFunction · 0.85

Calls 1

_check_deviceFunction · 0.85

Tested by

no test coverage detected