def qa_rnn(config, is_training, input_seqs, input_masks, xvector=None):
"""Model that takes as input several input sequences, output the encoded vector
for each of the sequence.
Args:
is_training: boolean. Indictates if the model is used for training or not.
input_seq: 2-D list of tensors, each is a [batch_size * embed_size] tensor.
"""
embed_seqs, atten_seqs, all_output_seqs = \
sentences_encoding(config, is_training, input_seqs, input_masks, xvector)
if NUMERIC_CHECK:
embed_seqs = tf.check_numerics(embed_seqs, 'qa_rnn output embedding numeric error')
atten_seqs = tf.check_numerics(atten_seqs, 'qa_rnn output attention numeric error')
all_output_seqs = tf.check_numerics(all_output_seqs, 'qa_rnn output numeric error')
return embed_seqs, atten_seqs, all_output_seqs
评论列表
文章目录