title: Batching and padding using the Tensorflow data API
body: <p>I'm having trouble understanding how the TensorFlow data API (tensorflow.data.Dataset) works. My
  input is a list of lists of integers that I want to batch, pad
  and concatenate. E.g my data looks like this</p>
  
  <pre><code>data = [[1, 2, 3, 4, 5, 6, 7],
          [1, 2, 3, 4],
          [1]]
  </code></pre>
  
  <p>with batch size 3 it should become:</p>
  
  <pre><code>[[[1, 2, 3], [4, 5, 6], [7, 0, 0]],
   [[1, 2, 3], [4, 0, 0]],
   [[1, 0, 0]]]
  </code></pre>
  
  <p>and finally:</p>
  
  <pre><code>[[1, 2, 3], [4, 5, 6], [7, 0, 0],
   [1, 2, 3], [4, 0, 0], [1, 0, 0]]
  </code></pre>