import tensorflow as tf

      @dynamic_batching.batch_fn
      def f(a, b):
        return a + b

      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])
