@kullback_leibler.RegisterKL(JointDistributionSequential,<EOL>JointDistributionSequential)<EOL>def _kl_joint_joint(d0, d1, name=None):
if len(d0._dist_fn_wrapped) != len(d1._dist_fn_wrapped):  <EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if (not all(a is None for a in d0._dist_fn_args) or  <EOL>not all(a is None for a in d1._dist_fn_args)):  <EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>with tf.name_scope(name or '<STR_LIT>'):<EOL><INDENT>return sum(kullback_leibler.kl_divergence(d0_(), d1_())<EOL>for d0_, d1_ in zip(d0._dist_fn_wrapped, d1._dist_fn_wrapped))<EOL><DEDENT>
Calculate the KL divergence between two `JointDistributionSequential`s.

    Args:
      d0: instance of a `JointDistributionSequential` object.
      d1: instance of a `JointDistributionSequential` object.
      name: (optional) Name to use for created operations.
        Default value: `"kl_joint_joint"`.

    Returns:
      kl_joint_joint: `Tensor` The sum of KL divergences between elemental
        distributions of two joint distributions.

    Raises:
      ValueError: when joint distributions have a different number of elemental
        distributions.
      ValueError: when either joint distribution has a distribution with dynamic
        dependency, i.e., when either joint distribution is not a collection of
        independent distributions.