title: How to do word embedding to provide input to RNN?
body: <p>I am trying to do word prediction using  basic RNN. I need to provide input to the RNN cell; I am trying following code</p>
  
  <pre><code>X_input = tf.placeholder(tf.int32, shape = (None, sequence_length, 1))
  Y_target = tf.placeholder(tf.int32, shape = (None, sequence_length, 1))
  
  tfWe = tf.Variable(tf.random_uniform((V, embedding_dim)))
  W1 = tf.Variable(np.random.randn(hidden_layer_size, label).astype(np.float32))
  b = tf.Variable(np.zeros(label).astype(np.float32))
  rnn = GRUCell(num_units = hidden_layer_size, activation = tf.nn.relu)
  
  x = tf.nn.embedding_lookup(tfWe, X_input)
  x = tf.unstack(x, sequence_length, 1)
  output, states = tf.nn.dynamic_rnn(rnn, x, dtype = tf.float32)
  output = tf.transpose(output, (1,0,2))
  output = tf.reshape(output, (sequence_length*num_samples,hidden_layer_size))
  </code></pre>
  
  <p>I am getting error <strong>ValueError: Layer gru_cell_2 expects 1 inputs, but it received 39 input tensors</strong>. I think this error is due to the embedding as that is not giving a tensor of dimension which can be input to the GRUCell. So, How to provide the input to GRU Cell?</p>