The below code gives me all the hidden state values of the unrolled RNN.

hidden_states,final_hidden_state = tf.nn.dyanamic_rnn(...)

How do I multiply each of the hidden_states with the weight "Why" shown in the figure.

I find this confusing because the shape of hidden_states is [mini_batch_size,max_seq_length,num_of_hidden_neurons]

Do I have to make some kind of for loop for each of the hidden state and then multiply by Why to get the y values?

Thanks !