'Build the feed dictionary, handles cases where there is no value defined.
Args:
train_name: The key into the datasets, to set the tf.case statement for
the proper readin / readout matrices.
data_bxtxd: The data tensor
ext_input_bxtxi (optional): The external input tensor
keep_prob: The drop out keep probability.
Returns:
The feed dictionary with TF tensors as keys and data as values, for use
with tf.Session.run()'

def build_feed_dict(self, train_name, data_bxtxd, ext_input_bxtxi=None, keep_prob=None):

    feed_dict = {}
    (B, T, _) = data_bxtxd.shape
    feed_dict[self.dataName] = train_name
    feed_dict[self.dataset_ph] = data_bxtxd
    if ((self.ext_input is not None) and (ext_input_bxtxi is not None)):
        feed_dict[self.ext_input] = ext_input_bxtxi
    if (keep_prob is None):
        feed_dict[self.keep_prob] = self.hps.keep_prob
    else:
        feed_dict[self.keep_prob] = keep_prob
    return feed_dict
