为什么sequence_length的变量在tensorflow-r1.0的ctc_beam_search_decoder中无用?

时间:2017-06-20 04:49:56

标签: python tensorflow beam-search

我想生成一批具有固定形状[batch_sizeseq_lenth]的序列。 因此我的代码:

output, _ = tf.nn.ctc_beam_search_decoder(
        logits,
        tf.ones([batch_size])*seq_length,
        merge_repeated=False
        )
output = tf.sparse_to_dense(output[0], default_value=end_id)

其中logits输出dynamic_rnn,其形状为[max_timebatch_sizecell_output_size]。我将seq_length设置为40。但结果output的形状不是[batch_sizeseq_length]。鉴于它的形状是动态的,我无法将其填充到固定的长度。那么我该怎么做以获得固定大小的输出?提前谢谢!

0 个答案:

没有答案