def __init__(self,<EOL>distribution_fn,<EOL>sample0=None,<EOL>num_steps=None,<EOL>validate_args=False,<EOL>allow_nan_stats=True,<EOL>name="<STR_LIT>"):
parameters = dict(locals())<EOL>with tf.name_scope(name) as name:<EOL><INDENT>self._distribution_fn = distribution_fn<EOL>self._sample0 = sample0<EOL>self._distribution0 = (distribution_fn() if sample0 is None<EOL>else distribution_fn(sample0))<EOL>if num_steps is None:<EOL><INDENT>num_steps = tensorshape_util.num_elements(<EOL>self._distribution0.event_shape)<EOL>if num_steps is None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>if num_steps < <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>".format(num_steps))<EOL><DEDENT>self._num_steps = num_steps<EOL><DEDENT>super(Autoregressive, self).__init__(<EOL>dtype=self._distribution0.dtype,<EOL>reparameterization_type=self._distribution0.reparameterization_type,<EOL>validate_args=validate_args,<EOL>allow_nan_stats=allow_nan_stats,<EOL>parameters=parameters,<EOL>graph_parents=self._distribution0._graph_parents,  <EOL>name=name)<EOL>
Construct an `Autoregressive` distribution.

        Args:
          distribution_fn: Python `callable` which constructs a
            `tfd.Distribution`-like instance from a `Tensor` (e.g.,
            `sample0`). The function must respect the "autoregressive property",
            i.e., there exists a permutation of event such that each coordinate is a
            diffeomorphic function of on preceding coordinates.
          sample0: Initial input to `distribution_fn`; used to
            build the distribution in `__init__` which in turn specifies this
            distribution's properties, e.g., `event_shape`, `batch_shape`, `dtype`.
            If unspecified, then `distribution_fn` should be default constructable.
          num_steps: Number of times `distribution_fn` is composed from samples,
            e.g., `num_steps=2` implies
            `distribution_fn(distribution_fn(sample0).sample(n)).sample()`.
          validate_args: Python `bool`.  Whether to validate input with asserts.
            If `validate_args` is `False`, and the inputs are invalid,
            correct behavior is not guaranteed.
          allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
            (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
            result is undefined. When `False`, an exception is raised if one or
            more of the statistic's batch members are undefined.
          name: Python `str` name prefixed to Ops created by this class.
            Default value: "Autoregressive".

        Raises:
          ValueError: if `num_steps` and
            `num_elements(distribution_fn(sample0).event_shape)` are both `None`.
          ValueError: if `num_steps < 1`.