import tensorflow as tf


  def test_two(self):
    with self.test_session() as session:
      @dynamic_batching.batch_fn
      def f(a, b):
        batch_size = tf.shape(a)[0]
        return a + b, tf.tile([batch_size], [batch_size])

      output0 = f(tf.constant([1]), tf.constant([2]))
      output1 = f(tf.constant([2]), tf.constant([3]))

      tp = pool.ThreadPool(2)
      f0 = tp.apply_async(session.run, [output0])
      f1 = tp.apply_async(session.run, [output1])

      # Make sure both inputs are in the batcher before starting it.
