问题描述:

I am wondering if the same holds for tf.split_v() as tf.split().

According to the documentation split_v also accepts a Tensor as second argument.

However, when I try this code

batch_size_ph = tf.placeholder(dtype = tf.int32, name='BatchSize')

seq_length_ph = tf.placeholder(dtype = tf.int32, name='SeqLength')

input_data = tf.placeholder(dtype=tf.float32, shape=[50, 25, 10])

inputs = tf.split_v(input_data,seq_length_ph, 1) #tf.ones(seq_length_ph, tf.int32)

#inputs = [tf.squeeze(input_, [1]) for input_ in inputs]

with tf.Session() as sess:

[out] = sess.run([inputs],feed_dict = {batch_size_ph: 50,

seq_length_ph: 25,

input_data: np.random.rand(50,25,10)})

print out

print len(out)

print out[0].shape

The error is

NameError: global name 'value_shape' is not defined

Is this possible or not?

相关阅读:
Top