code: def test_default_event_space_bijector_non_interacting(self):
      root = jd.JointDistributionCoroutine.Root
  
      @jdc.JointDistributionCoroutine
      def model():
          x = yield root(lognormal.LogNormal(0.0, 1.0, name="x"))
          yield sample_dist_lib.Sample(
              lognormal.LogNormal(0.0, x),
              test_lib.NUM_DEVICES,
              name="y",
          )
          yield sample_dist_lib.Sample(
              scale.Scale(2.0)(normal.Normal(0.0, 1.0)),
              test_lib.NUM_DEVICES,
              name="z",
          )
  
      @jd.JointDistributionCoroutine
      def sharded_model():
          x = yield root(lognormal.LogNormal(0.0, 1.0, name="x"))
          yield sharded.Sharded(
              lognormal.LogNormal(0.0, x),
              shard_axis_name=self.axis_name,
              name="y",
          )
          yield sharded.Sharded(
              scale.Scale(2.0)(normal.Normal(0.0, 1.0)),
              shard_axis_name=self.axis_name,
              name="z",
          )
  
      sample = self.evaluate(model.sample(seed=self.key))
      unconstrained_sample = (
          model.experimental_default_event_space_bijector().inverse(
              sample
          )
      )
  
      def unconstrained_lp(model, unconstrained_sample):
          unconstrained_sample = tf.nest.map_structure(
              tf.identity, unconstrained_sample
          )
          bij = model.experimental_default_event_space_bijector()
          sample = bij(unconstrained_sample)
          lp = model.log_prob(sample)
          fldj = bij.forward_log_det_jacobian(unconstrained_sample)
          return lp + fldj
  
      true_lp, (true_g,) = gradient.value_and_gradient(
          lambda unconstrained_sample: unconstrained_lp(  # pylint: disable=g-long-lambda
              model, unconstrained_sample
          ),
          (unconstrained_sample,),
      )
  
      def run(unconstrained_sample):
          return gradient.value_and_gradient(
              lambda unconstrained_sample: unconstrained_lp(  # pylint: disable=g-long-lambda
                  sharded_model, unconstrained_sample
              ),
              (unconstrained_sample,),
          )
  
      sharded_unconstrained_sample = unconstrained_sample._replace(
          y=self.shard_values(unconstrained_sample.y),
          z=self.shard_values(unconstrained_sample.z),
      )
  
      lp, (g,) = self.per_replica_to_tensor(
          self.strategy_run(
              run,
              (sharded_unconstrained_sample,),
              in_axes=(model.dtype._replace(x=None, y=0, z=0),),
          )
      )
      lp = lp[0]
      g = g._replace(x=g.x[0])
  
      self.assertAllClose(true_lp, lp)
      self.assertAllCloseNested(true_g, g)
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.experimental.distribute import joint_distribution
  from tensorflow_probability.python.experimental.distribute import sharded
  from tensorflow_probability.python.internal import distribute_test_lib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 8 for calling the JointDistributionTest obj's underlying member method code with example usage: obj.test_default_event_space_bijector_non_interacting() and returns: unknown, gradient