import tensorflow as tf


      with self.assertRaisesRegexp(
          tf.errors.InvalidArgumentError,
          'Output shape must have the same batch dimension as the input batch '
          'size. Expected: 1 Observed: 4'):
        coord.join()

  def test_get_inputs_cancelled(self):
    with tf.Graph().as_default():

      @dynamic_batching.batch_fn
      def f(a):
        return a

      f(tf.constant([1]))

