class_docstr: Tests the Autoregressive distribution.
class_docstr_tok: ["Tests","the","Autoregressive","distribution","."]
code: def testSampleAndLogProbConsistency(self):
      batch_shape = np.int32([])
      event_size = 2
      batch_event_shape = np.concatenate(
          [batch_shape, [event_size]], axis=0
      )
      sample0 = tf.zeros(batch_event_shape)
      affine = scale_matvec_tril.ScaleMatvecTriL(
          scale_tril=self._random_scale_tril(event_size),
          validate_args=True,
      )
      ar = autoregressive.Autoregressive(
          self._normal_fn(affine), sample0, validate_args=True
      )
      self.run_test_sample_consistent_log_prob(
          self.evaluate,
          ar,
          num_samples=int(1e6),
          radius=1.0,
          center=0.0,
          rtol=0.01,
          seed=test_util.test_seed(),
      )
  
imports: import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import masked_autoregressive
  from tensorflow_probability.python.bijectors import scale_matvec_tril
  from tensorflow_probability.python.distributions import autoregressive
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import linalg
label_desc: Use image node_id 4 for calling the AutoregressiveTest obj's underlying member method code with example usage: obj.testSampleAndLogProbConsistency() without return types