def assign_variable_placeholders(placeholder_dict, slice_dict):
    """
    Builds feed dictionary for Tensorflow from the placeholder
    dictionary which holds information about variables
    and variable slice information

    Parameters
    ----------
    placeholder_dict : dict
           Dictionary of {tensorflow.placeholder : data_key} pairs
    slice_dict : dict
           Dictionary of {variable : slice} pairs

    Returns
    -------
    feed_dict : dict
          Dictionary to feed in Tensorflow session
    """
    feed_dict = {}
    for placeholder, data_key in placeholder_dict.items():
        var, slice_end = data_key
        try:
            feed_dict[placeholder] = getattr(slice_dict[var], slice_end)
        except KeyError:
            pass
    return feed_dict
