code: def test_constrained_affine_from_joint_inputs(self):
      base_distribution = jds.JointDistributionSequential(
          [
              sample.Sample(
                  normal.Normal(0.0, 1.0), sample_shape=[3, 2]
              ),
              logistic.Logistic(0.0, 1.0),
              sample.Sample(normal.Normal(0.0, 1.0), sample_shape=[4]),
          ],
          validate_args=True,
      )
      operator = tf.linalg.LinearOperatorBlockDiag(
          operators=[
              tf.linalg.LinearOperatorScaledIdentity(
                  6, multiplier=tf.Variable(1.0)
              ),
              tf.linalg.LinearOperatorDiag(tf.Variable([1.0])),
              tf.linalg.LinearOperatorDiag(tf.Variable(tf.ones([4]))),
          ],
          is_non_singular=True,
      )
      bijector = joint_map.JointMap(
          [exp.Exp(), identity.Identity(), softplus.Softplus()],
          validate_args=True,
      )
      surrogate_posterior = self._initialize_surrogate(
          "build_affine_surrogate_posterior_from_base_distribution",
          seed=test_util.test_seed(),
          base_distribution=base_distribution,
          operators=operator,
          bijector=bijector,
          validate_args=True,
      )
      posterior_sample = surrogate_posterior.sample(
          seed=test_util.test_seed()
      )
      posterior_logprob = surrogate_posterior.log_prob(posterior_sample)
      sample_, log_prob_ = self.evaluate(
          [posterior_sample, posterior_logprob]
      )
      self.assertEmpty(ps.shape(log_prob_))
      self.assertAllFinite(log_prob_)
      self.assertAllEqualNested(
          self.evaluate(base_distribution.event_shape_tensor()),
          nest.map_structure(ps.shape, sample_),
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import fill_triangular
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import joint_map
  from tensorflow_probability.python.bijectors import masked_autoregressive
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import laplace
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.experimental.vi import surrogate_posteriors
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.vi import optimization
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling the AffineSurrogatePosterior obj's underlying member method code with example usage: obj.test_constrained_affine_from_joint_inputs() without return types