import tensorflow as tf

    mvn_static = tfd.MultivariateNormalDiag(
        loc=np.zeros([2, 2]), name="MVN")
    self.assertEqual(
        str(mvn_static),
        "tfp.distributions.MultivariateNormalDiag("
        "\"MVN/\", "
        "batch_shape=(2,), "
        "event_shape=(2,), "
        "dtype=float64)")

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

    mvn_dynamic = tfd.MultivariateNormalDiag(
        loc=tf.placeholder_with_default(
            input=np.ones((3, 3), dtype=np.float32), shape=[None, 3]),
        name="MVN2")
    self.assertEqual(
        str(mvn_dynamic),
        "tfp.distributions.MultivariateNormalDiag("
        "\"MVN2/\", "
        "batch_shape=(?,), "  # Partially known.
