import tensorflow as tf

                                               lambda: tf.shape(x)))

      x = tf.placeholder(dtype=tf.int32, shape=[1])
      # None would fire an exception were it actually executed.
      self.assertFalse(normal._is_scalar_helper(x.get_shape, lambda: None))
      self.assertFalse(normal._is_scalar_helper(lambda: tf.TensorShape(None),
                                                lambda: tf.shape(x)))

      # Test case 3.
      x = tf.placeholder(dtype=tf.int32)
      is_scalar = normal._is_scalar_helper(x.get_shape, lambda: tf.shape(x))
      self.assertTrue(is_scalar.eval(feed_dict={x: 1}))
      self.assertFalse(is_scalar.eval(feed_dict={x: [1]}))


if __name__ == '__main__':
  tf.test.main()
