parameters: (decode_fn, element_spec, tensor_list)
return_statement: return nest.pack_sequence_as(element_spec, flat_ret)
docstring: Returns an element constructed from the given spec and tensor list.
  
    Args:
      decode_fn: Method that constructs an element component from the element spec
        component and a tensor list.
      element_spec: A nested structure of `tf.TypeSpec` objects representing to
        element type specification.
      tensor_list: A list of tensors to use for constructing the value.
  
    Returns:
      An element constructed from the given spec and tensor list.
  
    Raises:
      ValueError: If the number of tensors needed to construct an element for
        the given spec does not match the given number of tensors.
docstring_summary: Returns an element constructed from the given spec and tensor list.
docstring_tokens: Returns an element constructed from the given spec and tensor list .
function: def _from_tensor_list_helper(decode_fn, element_spec, tensor_list):
    """Returns an element constructed from the given spec and tensor list.
  
    Args:
      decode_fn: Method that constructs an element component from the element spec
        component and a tensor list.
      element_spec: A nested structure of `tf.TypeSpec` objects representing to
        element type specification.
      tensor_list: A list of tensors to use for constructing the value.
  
    Returns:
      An element constructed from the given spec and tensor list.
  
    Raises:
      ValueError: If the number of tensors needed to construct an element for
        the given spec does not match the given number of tensors.
    """
  
    # pylint: disable=protected-access
  
    flat_specs = nest.flatten(element_spec)
    flat_spec_lengths = [len(spec._flat_tensor_specs) for spec in flat_specs]
    if sum(flat_spec_lengths) != len(tensor_list):
      raise ValueError("Expected %d tensors but got %d." %
                       (sum(flat_spec_lengths), len(tensor_list)))
  
    i = 0
    flat_ret = []
    for (component_spec, num_flat_values) in zip(flat_specs, flat_spec_lengths):
      value = tensor_list[i:i + num_flat_values]
      flat_ret.append(decode_fn(component_spec, value))
      i += num_flat_values
    return nest.pack_sequence_as(element_spec, flat_ret)
function_tokens: def _from_tensor_list_helper ( decode_fn , element_spec , tensor_list ) : # pylint: disable=protected-access flat_specs = nest . flatten ( element_spec ) flat_spec_lengths = [ len ( spec . _flat_tensor_specs ) for spec in flat_specs ] if sum ( flat_spec_lengths ) != len ( tensor_list ) : raise ValueError ( "Expected %d tensors but got %d." % ( sum ( flat_spec_lengths ) , len ( tensor_list ) ) ) i = 0 flat_ret = [ ] for ( component_spec , num_flat_values ) in zip ( flat_specs , flat_spec_lengths ) : value = tensor_list [ i : i + num_flat_values ] flat_ret . append ( decode_fn ( component_spec , value ) ) i += num_flat_values return nest . pack_sequence_as ( element_spec , flat_ret )