code: def _test_normal_normal(self, Inference, default, *args, **kwargs):
      with self.test_session() as sess:
          x_data = np.array([0.0] * 50, dtype=np.float32)
  
          mu = Normal(loc=0.0, scale=1.0)
          x = Normal(loc=mu, scale=1.0, sample_shape=50)
  
          if not default:
              qmu_loc = tf.Variable(tf.random_normal([]))
              qmu_scale = tf.nn.softplus(
                  tf.Variable(tf.random_normal([]))
              )
              qmu = Normal(loc=qmu_loc, scale=qmu_scale)
  
              # analytic solution: N(loc=0.0, scale=\sqrt{1/51}=0.140)
              inference = Inference({mu: qmu}, data={x: x_data})
          else:
              inference = Inference([mu], data={x: x_data})
              qmu = inference.latent_vars[mu]
          inference.run(*args, **kwargs)
  
          self.assertAllClose(qmu.mean().eval(), 0, rtol=0.1, atol=0.6)
          self.assertAllClose(
              qmu.stddev().eval(), np.sqrt(1 / 51), rtol=0.15, atol=0.5
          )
  
          variables = tf.get_collection(
              tf.GraphKeys.GLOBAL_VARIABLES, scope="optimizer"
          )
          old_t, old_variables = sess.run([inference.t, variables])
          self.assertEqual(old_t, inference.n_iter)
          sess.run(inference.reset)
          new_t, new_variables = sess.run([inference.t, variables])
          self.assertEqual(new_t, 0)
          self.assertNotEqual(old_variables, new_variables)
  
file_path: edward/tests/inferences/klqp_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 Bernoulli, Normal
label_desc: Use image node_id 1 for calling the test_klqp_class obj's underlying member method code with example usage: obj._test_normal_normal(Inference, default) without return types