def calc_seqlenth(input):
# this code is copied from TFLearn retrieve seqlenth method. Credited to it's creator @aymericdamien
with tf.name_scope('GetLength'):
used = tf.sign(tf.reduce_max(tf.abs(input), reduction_indices=2))
length = tf.reduce_sum(used, reduction_indices=1)
length = tf.cast(length, tf.int32)
return length
# This code is copied from TFLearn advanced_indexing_op() method. Credited to it's creator @aymericdamien
评论列表
文章目录