import tensorflow as tf
a = tf.constant([[1,2,3], [1,2,3], [1,2,3]])
l = tf.constant([2,2,2],tf.int64)
b = tf.reverse_sequence(a,seq_lengths=l,batch_dim = 0,seq_dim = 1)
c = tf.Print(b,[b],summarize=9)
with tf.Session() as sess:
sess.run(c)
微信扫一扫
import tensorflow as tf
a = tf.constant([[1,2,3], [1,2,3], [1,2,3]])
l = tf.constant([2,2,2],tf.int64)
b = tf.reverse_sequence(a,seq_lengths=l,batch_dim = 0,seq_dim = 1)
c = tf.Print(b,[b],summarize=9)
with tf.Session() as sess:
sess.run(c)
相关推荐