class_docstr: Well tested because this is a simple override of the base class.
code: def testMultivariateNormalDiagNegLogLikelihood(self):
      num_draws = 50
      dims = 3
      x = np.zeros([num_draws, dims], dtype=np.float32)
      x_pl = tf1.placeholder_with_default(
          x, shape=[None, dims], name="x"
      )
  
      def neg_log_likelihood(mu):
          mvn = mvn_diag.MultivariateNormalDiag(
              loc=mu,
              scale_diag=tf.ones(shape=[dims], dtype=tf.float32),
              validate_args=True,
          )
  
          # Typically you'd use `mvn.log_prob(x_pl)` which is always at least as
          # numerically stable as `tf.log(mvn.prob(x_pl))`. However in this test
          # we're testing a bug specific to `prob` and not `log_prob`;
          # http://stackoverflow.com/q/45109305. (The underlying issue was not
          # related to `Distributions` but that `reduce_prod` didn't correctly
          # handle negative indexes.)
          return -tf.reduce_sum(tf.math.log(mvn.prob(x_pl)))
  
      mu_var = tf.fill([dims], value=np.float32(1))
      _, grad_neg_log_likelihood = gradient.value_and_gradient(
          neg_log_likelihood, mu_var
      )
  
      self.assertAllClose(
          self.evaluate(grad_neg_log_likelihood),
          np.tile(num_draws, dims),
          rtol=1e-6,
          atol=0.0,
      )
  
imports: import os
  from absl.testing import parameterized
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 14 for calling the MultivariateNormalDiagTest obj's underlying member method code with example usage: obj.testMultivariateNormalDiagNegLogLikelihood() and returns: unknown