parameters: (reduction, tensors)
return_statement: return result
docstring: Helper function for reduce_* functions.
docstring_summary: Helper function for reduce_* functions.
docstring_tokens: Helper function for reduce_ * functions .
function: def _apply_reduce(reduction, tensors):
    """Helper function for reduce_* functions."""
    if not tensors:
      raise ValueError('Must pass >0 tensors to reduce operations')
  
    for t in tensors:
      _check_device(t)
    result = gen_nccl_ops.nccl_reduce(input=tensors, reduction=reduction)
    try:
      next(t for t in tensors if t.device == result.device)
    except StopIteration:
      raise ValueError('One input tensor must be assigned to current device')
    return result
function_tokens: def _apply_reduce ( reduction , tensors ) : if not tensors : raise ValueError ( 'Must pass >0 tensors to reduce operations' ) for t in tensors : _check_device ( t ) result = gen_nccl_ops . nccl_reduce ( input = tensors , reduction = reduction ) try : next ( t for t in tensors if t . device == result . device ) except StopIteration : raise ValueError ( 'One input tensor must be assigned to current device' ) return result