code: def test_sample_with_partially_specified_value(self, sampler_type):
      num_features = 5
  
      def dist():
          scale_variance = yield inverse_gamma.InverseGamma(0.5, 0.5)
          scale_noncentered = yield sample_lib.Sample(
              half_normal.HalfNormal(1.0), num_features
          )
          scale = scale_noncentered * scale_variance[..., None] ** 0.5
          weights_noncentered = yield sample_lib.Sample(
              normal.Normal(0.0, 1.0), num_features
          )
          yield deterministic.Deterministic(weights_noncentered * scale)
  
      joint = jdab.JointDistributionCoroutineAutoBatched(
          dist, validate_args=True
      )
  
      value_partial_batch_dim = 4
      value_ = (
          3.0,
          None,
          None,
          np.ones([value_partial_batch_dim, num_features]),
      )
      value = [
          None if v is None else tf.cast(v, tf.float32) for v in value_
      ]
  
      # The sample should keep the specified values.
      xs = self.evaluate(
          joint.sample(
              value=value,
              seed=test_util.test_seed(sampler_type=sampler_type),
          )
      )
      self.assertAllEqual(
          xs[0], tf.fill([value_partial_batch_dim], value[0])
      )
      self.assertAllEqual(
          xs[1].shape, [value_partial_batch_dim, num_features]
      )
      self.assertAllEqual(
          xs[2].shape, [value_partial_batch_dim, num_features]
      )
      self.assertAllEqual(xs[3], value[3])
  
      # With sample shape.
      sample_shape = [6, 2]
      samples = joint.sample(
          sample_shape,
          value=value,
          seed=test_util.test_seed(sampler_type=sampler_type),
      )
      xs = self.evaluate(samples)
      expect_shp = sample_shape + [
          value_partial_batch_dim,
          num_features,
      ]
      self.assertAllEqual(
          xs[0],
          tf.fill(sample_shape + [value_partial_batch_dim], value[0]),
      )
      self.assertAllEqual(xs[1].shape, expect_shp)
      self.assertAllEqual(xs[2].shape, expect_shp)
      self.assertAllEqual(xs[3], value[3] * tf.ones(expect_shp))
  
      sample_shape_dynamic = tf1.placeholder_with_default(
          sample_shape, shape=None
      )
      samples = joint.sample(
          sample_shape_dynamic,
          value=value,
          seed=test_util.test_seed(sampler_type=sampler_type),
      )
      xs = self.evaluate(samples)
      self.assertAllEqual(
          xs[0],
          tf.fill(sample_shape + [value_partial_batch_dim], value[0]),
      )
      self.assertAllEqual(xs[1].shape, expect_shp)
      self.assertAllEqual(xs[2].shape, expect_shp)
      self.assertAllEqual(xs[3], value[3] * tf.ones(expect_shp))
  
imports: import collections
  import os
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import dirichlet
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import half_normal
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  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 lognormal
  from tensorflow_probability.python.distributions import multinomial
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.util import deferred_tensor
label_desc: Use image node_id 12 for calling the JointDistributionAutoBatchedTest obj's underlying member method code with example usage: obj.test_sample_with_partially_specified_value(sampler_type) without return types