0

What is the right way to initialize a tensorarray from another tensor in tensorflow.

Suppose I have a tensor

T1 

TensorArr = tf.TensorArray(tf.int32, 1, dynamic_size=True)

What is way to say that this tensorarray depends on T1? Looking at the documentation I cant figure out how to initialize this.

Correct me if my understanding is wrong, T1 is a nested tensor and I want to loop over a dimension using tf.while_loop and hence I want to initialize the TensorArray with it.

1 Answer 1

1

In documentation for raw_rnn, they use

inputs_ta = tf.TensorArray(dtype=tf.float32, size=max_time)
inputs_ta = inputs_ta.unstack(inputs)

inputs is a tensor with shape: (max_time,batch_size,num_hidden). Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.