code: def test_hmc_default(self):
      with self.test_session() as sess:
          x = TransformedDistribution(
              distribution=Normal(1.0, 1.0),
              bijector=tf.contrib.distributions.bijectors.Softplus(),
          )
          x.support = "nonnegative"
  
          inference = ed.HMC([x])
          inference.initialize(auto_transform=True, step_size=0.8)
          tf.global_variables_initializer().run()
          for _ in range(inference.n_iter):
              info_dict = inference.update()
              inference.print_progress(info_dict)
  
          # Check approximation on constrained space has same moments as
          # target distribution.
          n_samples = 1000
          qx_constrained = inference.latent_vars[x]
          x_mean, x_var = tf.nn.moments(x.sample(n_samples), 0)
          qx_mean, qx_var = tf.nn.moments(
              qx_constrained.params[500:], 0
          )
          stats = sess.run([x_mean, qx_mean, x_var, qx_var])
          self.assertAllClose(stats[0], stats[1], rtol=1e-1, atol=1e-1)
          self.assertAllClose(stats[2], stats[3], rtol=1e-1, atol=1e-1)
  
file_path: edward/tests/inferences/inference_auto_transform_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 Empirical, Gamma, Normal, PointMass, TransformedDistribution, Beta, Bernoulli
  from edward.util import transform
  from tensorflow.contrib.distributions import bijectors
label_desc: Use image node_id 7 for calling the test_inference_auto_transform_class obj's underlying member method code with example usage: obj.test_hmc_default() without return types