from tensorflow.python.framework import tensor_util


  def testIsScalar(self):
    with self.test_session():
      mu = 1.
      sigma = 2.

      normal = dists.Normal(mu, sigma,
                            validate_args=True)
      self.assertTrue(tensor_util.constant_value(normal.is_scalar_event))
      self.assertTrue(tensor_util.constant_value(normal.is_scalar_batch))

      normal = dists.Normal([mu], [sigma],
                            validate_args=True)
      self.assertTrue(tensor_util.constant_value(normal.is_scalar_event))
      self.assertFalse(tensor_util.constant_value(normal.is_scalar_batch))

