code: def testSampleVariance(self, dtype):
      seed_stream = test_util.test_seed_stream()
      loc = tf.random.normal([20], dtype=dtype, seed=seed_stream())
      scale = tf.random.uniform(
          [20], minval=0.5, maxval=2.0, dtype=dtype, seed=seed_stream()
      )
      low = tf.random.uniform(
          [20],
          minval=-50.0,
          maxval=50.0,
          dtype=dtype,
          seed=seed_stream(),
      )
      high = tf.random.uniform(
          [20],
          minval=-50.0,
          maxval=50.0,
          dtype=dtype,
          seed=seed_stream(),
      )
      low, high = tf.math.minimum(low, high), tf.math.maximum(low, high)
      tc = truncated_cauchy.TruncatedCauchy(
          loc, scale, low, high, validate_args=True
      )
      samples_, variance_ = self.evaluate(
          [tc.sample(int(1e6), seed=seed_stream()), tc.variance()]
      )
      self.assertAllClose(
          variance_, np.var(samples_, axis=0), rtol=0.1, atol=0.1
      )
  
file_path: probability/tensorflow_probability/python/distributions/truncated_cauchy_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import cauchy
  from tensorflow_probability.python.distributions import truncated_cauchy
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 8 for calling the TruncatedCauchyTest obj's underlying member method code with example usage: obj.testSampleVariance(dtype) without return types