title: How to get subset of 10K MNIST images from Dataset class in tensorflow?
body: <p>I found the following way to get mnist dataset in tensorflow:</p>
  
  <pre><code>def get_input_fn(dataset_split, batch_size, capacity=10000, min_after_dequeue=3000):
  
    def _input_fn():
      images_batch, labels_batch = tf.train.shuffle_batch(
          tensors=[dataset_split.images, dataset_split.labels.astype(np.int32)],
          batch_size=batch_size,
          capacity=capacity,
          min_after_dequeue=min_after_dequeue,
          enqueue_many=True,
          num_threads=4)
      features_map = {'images': images_batch}
      return features_map, labels_batch
  
    return _input_fn
  
      data = tf.contrib.learn.datasets.mnist.load_mnist()
  
      train_input_fn = get_input_fn(data.train, batch_size=256)
      eval_input_fn = get_input_fn(data.validation, batch_size=5000)
  </code></pre>
  
  <p>data variable is Dataset object. 
  This approach is quite unclear to me and I cannot figure out how to convert 60K dataset into 10K dataset.</p>
  
  <p>When I do the following:</p>
  
  <pre><code>data = tf.contrib.learn.datasets.mnist.load_mnist().take(10000)
  </code></pre>
  
  <p>I get error:</p>
  
  <pre><code>AttributeError: 'Datasets' object has no attribute 'take'
  </code></pre>
  
  <p>But docs provide this method:
  <a href="https://i.stack.imgur.com/o6v4Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o6v4Q.png" alt="enter image description here"></a></p>
  
  <p>Thank you for help!</p>