title: How to use embedding_lookup with a batch of different length sequences in Tensorflow?
body: <p>Say I have an embedding tensor:</p>
  
  <pre><code>emb = [[1,1],
         [2,2],
         [3,3],
         [4,4]]
  emb = tf.constant(emb)
  </code></pre>
  
  <p>I have a list of sequences:</p>
  
  <pre><code>inputs = [[0,1,2,3]
            [3,2]]
  </code></pre>
  
  <p>I'd like to lookup the <code>emb</code> and pad zeros to make each sequence has the same length:</p>
  
  <pre><code>  [[[1, 1],
      [2, 2],
      [3, 3],
      [4, 4]],
  
     [[4, 4],
      [3, 3],
      [0, 0],
      [0, 0]]]
  </code></pre>
  
  <p>I tried <code>tf.nn.embedding_lookup</code>, but got an error:</p>
  
  <blockquote>
    <p>ValueError: Argument must be a dense tensor: [[0, 1, 2, 3], [3, 2]] -
    got shape [2], but wanted [2, 4].</p>
  </blockquote>
  
  <p>Is it possible to achieve this without prepending <code>[0, 0]</code> to <code>emb</code>?</p>