docstr: Sampling from the Standard Normal Distribution.
docstr_tok: ["Sampling","from","the","Standard","Normal","Distribution","."]
code: def testOneDimNormal(self, asserts):
      """Sampling from the Standard Normal Distribution."""
      dtype = np.float32
      num_results, tolerance = _get_mode_dependent_settings()
      # We're not using multiple chains in this test, so dial up samples.
      num_results = int(num_results * (5 if asserts else 0.2))
      target = normal.Normal(loc=dtype(0), scale=dtype(1))
  
      kernel = slice_sampler_kernel.SliceSampler(
          target.log_prob, step_size=1.0, max_doublings=5
      )
      if asserts:
          kernel.one_step = tf.function(
              kernel.one_step, autograph=False
          )
      samples = sample.sample_chain(
          num_results=num_results,
          current_state=dtype(1),
          kernel=kernel,
          num_burnin_steps=100,
          trace_fn=None,
          seed=test_util.test_seed_stream(),
      )
  
      sample_mean = tf.reduce_mean(samples, axis=0)
      sample_std = sample_stats.stddev(samples)
  
      if not asserts:
          return
      self.assertAllClose(
          0.0, sample_mean, atol=tolerance, rtol=tolerance
      )
      self.assertAllClose(
          1.0, sample_std, atol=tolerance, rtol=tolerance
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  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 random_walk_metropolis
  from tensorflow_probability.python.mcmc import sample
  from tensorflow_probability.python.mcmc import slice_sampler_kernel
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 1 for calling the SliceSamplerTest obj's underlying member method code with example usage: obj.testOneDimNormal(asserts) without return types