code: def test_gaussian_probability_sums_to_one(self, n_dims):
      std = 1.0
      n_samples = 10000
  
      distribution = distributions.Gaussian(shape=(n_dims,), std=std)
      means = np.random.random((3, n_dims))
      # Monte carlo integration over [mean - 3 * std, mean + 3 * std] across
      # all dimensions.
      means = np.broadcast_to(means, (n_samples,) + means.shape)
      probs = (6 * std) ** n_dims * np.mean(
          np.exp(
              distribution.log_prob(
                  means,
                  np.random.uniform(means - 3 * std, means + 3 * std),
              )
          ),
          axis=0,
      )
      # Should sum to one. High tolerance because of variance and cutting off the
      # tails.
      np.testing.assert_allclose(probs, np.ones_like(probs), atol=0.05)
  
file_path: trax/trax/rl/distributions_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import gin
  import gym
  import numpy
  from trax.rl import distributions
label_desc: Use image node_id 3 for calling the DistributionsTest obj's underlying member method code with example usage: obj.test_gaussian_probability_sums_to_one(n_dims) without return types