class_docstr: Tests the Autoregressive distribution.
class_docstr_tok: ["Tests","the","Autoregressive","distribution","."]
code: def testErrorOnNonScalarNumSteps(self):
      def fn(sample=0.0):
          return normal.Normal(loc=tf.zeros_like(sample), scale=1.0)
  
      num_steps = [4, 4, 4]
      with self.assertRaisesRegexp(
          Exception, "Argument `num_steps` must be a scalar"
      ):
          ar = autoregressive.Autoregressive(
              fn, num_steps=num_steps, validate_args=True
          )
          self.evaluate(ar.sample(seed=test_util.test_seed()))
  
      num_steps = tf.Variable(4, shape=tf.TensorShape(None))
      self.evaluate(num_steps.initializer)
      ar = autoregressive.Autoregressive(
          fn, num_steps=num_steps, validate_args=True
      )
      self.evaluate(ar.sample(seed=test_util.test_seed()))
      with self.assertRaisesRegexp(
          Exception, "Argument `num_steps` must be a scalar"
      ):
          with tf.control_dependencies([num_steps.assign([17, 3])]):
              self.evaluate(ar.sample(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 10 for calling the AutoregressiveTest obj's underlying member method code with example usage: obj.testErrorOnNonScalarNumSteps() and returns: normal