parameters: (value_destination_pairs)
return_statement: return result
docstring: Converts each tensor into a PerReplica object in the input list.
docstring_summary: Converts each tensor into a PerReplica object in the input list.
docstring_tokens: Converts each tensor into a PerReplica object in the input list .
function: def _normalize_value_destination_pairs(value_destination_pairs):
    """Converts each tensor into a PerReplica object in the input list."""
    result = []
  
    value_destination_pairs = list(value_destination_pairs)
  
    if not isinstance(value_destination_pairs, (list, tuple)):
      raise ValueError("`value_destination_pairs` should be a list or tuple")
    for pair in value_destination_pairs:
      if not isinstance(pair, tuple):
        raise ValueError(
            "Each element of `value_destination_pairs` should be a tuple.")
      if len(pair) != 2:
        raise ValueError("Each element of `value_destination_pairs` should be a "
                         "tuple of size 2.")
  
      per_replica = _make_tensor_into_per_replica(pair[0])
      result.append((per_replica, pair[1]))
    return result
function_tokens: def _normalize_value_destination_pairs ( value_destination_pairs ) : result = [ ] value_destination_pairs = list ( value_destination_pairs ) if not isinstance ( value_destination_pairs , ( list , tuple ) ) : raise ValueError ( "`value_destination_pairs` should be a list or tuple" ) for pair in value_destination_pairs : if not isinstance ( pair , tuple ) : raise ValueError ( "Each element of `value_destination_pairs` should be a tuple." ) if len ( pair ) != 2 : raise ValueError ( "Each element of `value_destination_pairs` should be a " "tuple of size 2." ) per_replica = _make_tensor_into_per_replica ( pair [ 0 ] ) result . append ( ( per_replica , pair [ 1 ] ) ) return result