import tensorflow as tf

        str(chi2),
        "tfp.distributions.Chi2("
        "\"silly/\", "  # What a silly name that is!
        "batch_shape=(2,), "
        "event_shape=(), "
        "dtype=float32)")

    # There's no notion of partially known shapes in eager mode, so exit
    # early.
    if tf.executing_eagerly():
      return

    exp = tfd.Exponential(rate=tf.placeholder_with_default(
        input=1., shape=None))
    self.assertEqual(
        str(exp),
        "tfp.distributions.Exponential(\"Exponential/\", "
        # No batch shape.
        "event_shape=(), "
        "dtype=float32)")

  def testStrWorksCorrectlyMultivariate(self):
    mvn_static = tfd.MultivariateNormalDiag(
        loc=np.zeros([2, 2]), name="MVN")
