code: def test_multivariate_normal_diag(self):
      with self.test_session() as sess:
          N, D, w_true, X_train, y_train, X, w, b, y = self._setup()
  
          # INFERENCE. Initialize scales at identity to verify if we
          # learned an approximately zero determinant.
          qw = MultivariateNormalDiag(
              loc=tf.Variable(tf.random_normal([D])),
              scale_diag=tf.Variable(tf.ones(D)),
          )
          qb = MultivariateNormalDiag(
              loc=tf.Variable(tf.random_normal([1])),
              scale_diag=tf.Variable(tf.ones(1)),
          )
  
          inference = ed.Laplace(
              {w: qw, b: qb}, data={X: X_train, y: y_train}
          )
          inference.run(n_iter=100)
  
          self._test(sess, qw, qb, w_true)
          self.assertAllClose(
              qw.covariance().eval(),
              tf.diag(tf.diag_part(qw.covariance())).eval(),
          )
          self.assertAllClose(
              qb.covariance().eval(),
              tf.diag(tf.diag_part(qb.covariance())).eval(),
          )
  
file_path: edward/tests/inferences/laplace_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import MultivariateNormalDiag, MultivariateNormalTriL, Normal
label_desc: Use image node_id 5 for calling the test_laplace_class obj's underlying member method code with example usage: obj.test_multivariate_normal_diag() without return types