import tensorflow as tf


  def test_output_must_have_batch_dimension(self):
    with self.test_session() as session:
      @dynamic_batching.batch_fn
      def f(_):
        return tf.constant(1)

      output = f(tf.constant([1]))

      coord = tf.train.Coordinator()
      tf.train.start_queue_runners(coord=coord)

      with self.assertRaises(tf.errors.CancelledError):
        session.run(output)
