title: Get length of a dataset in Tensorflow
body: <pre><code>source_dataset = tf.data.TextLineDataset('primary.csv')
  target_dataset = tf.data.TextLineDataset('secondary.csv')
  dataset = tf.data.Dataset.zip((source_dataset, target_dataset))
  dataset = dataset.shard(10000, 0)
  dataset = dataset.map(lambda source, target: (tf.string_to_number(tf.string_split([source], delimiter=',').values, tf.int32),
                                                tf.string_to_number(tf.string_split([target], delimiter=',').values, tf.int32)))
  dataset = dataset.map(lambda source, target: (source, tf.concat(([start_token], target), axis=0), tf.concat((target, [end_token]), axis=0)))
  dataset = dataset.map(lambda source, target_in, target_out: (source, tf.size(source), target_in, target_out, tf.size(target_in)))
  
  dataset = dataset.shuffle(NUM_SAMPLES)  #This is the important line of code
  </code></pre>
  
  <p>I would like to shuffle my entire dataset fully, but <code>shuffle()</code> requires a number of samples to pull, and <code>tf.Size()</code> does not work with <code>tf.data.Dataset</code>.</p>
  
  <p>How can I shuffle properly?</p>