I want to be able to feed a initial state to a network via a placeholder and TensorFlow only allow array or tensor to be feed (And I don't know how to create a zer initiale state tuple) . But the tf.nn.dynamic_rnn
function recquire a tuple of size 3. In the answer of this post: How do I set TensorFlow RNN state when state_is_tuple=True?
is exposed a method to do this conversion but the function utilised l = tf.unpack(state_placeholder, axis=0)
doesn't exist anymore. How can i perform the conversion from a tensor of shape (num_layer,2,batch_size,hidden_layers) feed to a placeholder to a tupple acceptable by tf.nn.dynamic_rnn
as a initial_state argument?
tf.unpack got replaced with tf.unstack. Can you use that instead?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.