title: Cannot batch tensors with different shapes in component 0 with tf.data.Dataset
body: <p>I have the following error in my input pipeline:</p>
  
  <blockquote>
    <p>tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot
    batch tensors with different shapes in component 0. First element had
    shape [2,48,48,3] and element 1 had shape [27,48,48,3].</p>
  </blockquote>
  
  <p>with this code</p>
  
  <pre><code>dataset = tf.data.Dataset.from_generator(generator,
                                           (tf.float32, tf.int64, tf.int64, tf.float32, tf.int64, tf.float32))
  
  dataset = dataset.batch(max_buffer_size)
  </code></pre>
  
  <p>This is completely logical as the batch method tries to create a (batch_size, ?, 48, 48, 3) Tensor. However I want that it creates a [29,48,48,3] Tensor for this case. So concatenate instead of stack. Is this possible with tf.data?</p>
  
  <p>I can do the concatenation in Python in the generator function, but I was wondering if this is also possible with the tf.data pipeline</p>