title: Tensorflow dataset with changing batch size to compute test loss during training
body: <p>I'm trying to run a training loop where I periodically determine the current average loss and print it to the console. In order to determine the loss I'd like to use a different batch size. So it goes like this:</p>
  
  <pre><code>dataset = create_dataset().shuffle(1000).repeat().batch(minibatch_size)
  iterator = dataset.make_one_shot_iterator() # using this iterator in the graph
  
  while ...:
   session.run(...) # perform training
  
   if epoch % 10 = 0:
    test_avg_loss = session.run(avg_loss) # want a different number of items here
  </code></pre>
  
  <p>I want a minibatch size of 10 during training but I'd like to test with 100 data points to obtain a better estimate for the average loss. How can make the dataset return a different number of items here? I tried passing a <code>placeholder</code> to <code>batch</code> but it seems unsupported. The error is:</p>
  
  <blockquote>
    <p>'ValueError : Cannot capture a placeholder (name:batchSize, type:Placeholder) by value.'</p>
  </blockquote>
  
  <p>I'm open to using a different code structure altogether if that seems like a better solution. I understand it is important to not pass data using <code>feedDict</code> for performance reasons so using a <code>dataset</code> seems like the way to go. I'm not seeking some kind of hack but I'd like to know what's the right way to do this.</p>