例如想知道seq2seq.dynamic_decode过程的输出结果
1.training_decoder_output保存了dynamic_decoder过程的结果,其形式为tuple(rnn_output,sample_id)
traing_logits获取了training_decoder_output中的rnn_output
用k1获取shape,k2获取具体traing_logits值
training_decoder_output, _, _ = tf.contrib.seq2seq.dynamic_decode(training_decoder,
impute_finished=True,
maximum_iterations=max_target_sequence_length)
training_logits = tf.identity(training_decoder_output.rnn_output, 'logits')
k1=tf.shape(training_logits)
k2=training_logits
2.在Session中,feed数据,并打印training_logits的值
m1,m2=sess.run([k1,k2],{input_data: sources_batch,
targets: targets_batch,
lr: learning_rate,
target_sequence_length: targets_lengths,
source_sequence_length: sources_lengths}
print('logits',m1)