import tensorflow as tf

      self.assertAllEqual([2], batch_size0)
      self.assertAllEqual([5], result1)
      self.assertAllEqual([2], batch_size1)

  def test_many_small(self):
    with self.test_session() as session:
      @dynamic_batching.batch_fn
      def f(a, b):
        return a + b

      outputs = []
      for i in xrange(200):
        outputs.append(f(tf.fill([1, 5], i), tf.fill([1, 5], i)))

      tf.train.start_queue_runners()

      tp = pool.ThreadPool(10)
      futures = []
      for output in outputs:
        futures.append(tp.apply_async(session.run, [output]))

      for i, future in enumerate(futures):
        result = future.get()
        self.assertAllEqual([[i * 2] * 5], result)

  def test_input_batch_size_should_be_one(self):
    with self.test_session() as session:
      @dynamic_batching.batch_fn
