code: def testDoesNotGoesInWrongDirection(self):
      # As above, we test a weaker property, which is that the variance and
      # mean estimates do not get too away if initialized at the true variance
      # and mean.
      initial_running_variance = (
          sample_stats.RunningVariance.from_stats(
              num_samples=10.0,
              mean=self.mvn_mean,
              variance=tf.convert_to_tensor(self.mvn_scale) ** 2,
          )
      )
      results = self._run_hmc(
          num_results=1000,
          initial_running_variance=initial_running_variance,
      )
  
      # Allow the large scale dimension to be a little further off
      fudge_factor = tf.sqrt(results.true_variance)
      final_mean_diff = tf.abs(results.final_mean - results.true_mean)
      np.testing.assert_array_less(
          self.evaluate(final_mean_diff), self.evaluate(fudge_factor)
      )
  
      final_std_diff = tf.abs(
          results.final_precision_factor
          - tf.sqrt(results.true_variance)
      )
      np.testing.assert_array_less(
          self.evaluate(final_std_diff), self.evaluate(fudge_factor)
      )
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.experimental.mcmc import diagonal_mass_matrix_adaptation
  from tensorflow_probability.python.experimental.mcmc import preconditioned_hmc
  from tensorflow_probability.python.experimental.mcmc import preconditioning_utils
  from tensorflow_probability.python.experimental.stats import sample_stats
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import distribute_test_lib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import sample
label_desc: Use image node_id 8 for calling the DiagonalMassMatrixAdaptationTest obj's underlying member method code with example usage: obj.testDoesNotGoesInWrongDirection() without return types