code: def test_proposal_weights_dont_affect_marginal_likelihood(self):
      observation = np.array([-1.3, 0.7]).astype(self.dtype)
      # This particle filter has proposals different from the dynamics,
      # so internally it will use proposal weights in addition to observation
      # weights. It should still get the observation likelihood correct.
      _, lps = self.evaluate(
          particle_filter.infer_trajectories(
              observation,
              initial_state_prior=normal.Normal(loc=0.0, scale=1.0),
              transition_fn=lambda _, x: normal.Normal(
                  loc=x, scale=1.0
              ),
              observation_fn=lambda _, x: normal.Normal(
                  loc=x, scale=1.0
              ),
              initial_state_proposal=normal.Normal(loc=0.0, scale=5.0),
              proposal_fn=lambda _, x: normal.Normal(loc=x, scale=5.0),
              num_particles=2048,
              seed=test_util.test_seed(),
          )
      )
  
      # Compare marginal likelihood against that
      # from the true (jointly normal) marginal distribution.
      y1_marginal_dist = normal.Normal(
          loc=0.0, scale=np.sqrt(1.0 + 1.0)
      )
      y2_conditional_dist = lambda y1: normal.Normal(
          loc=y1 / 2.0, scale=np.sqrt(5.0 / 2.0)
      )
      true_lps = tf.stack(
          [
              y1_marginal_dist.log_prob(observation[0]),
              y2_conditional_dist(observation[0]).log_prob(
                  observation[1]
              ),
          ],
          axis=0,
      )
      # The following line passes at atol = 0.01 if num_particles = 32768.
      self.assertAllClose(true_lps, lps, atol=0.2)
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_tril
  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 transformed_distribution
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.experimental.mcmc import particle_filter
  from tensorflow_probability.python.internal import prefer_static
  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 _ParticleFilterTest obj's underlying member method code with example usage: obj.test_proposal_weights_dont_affect_marginal_likelihood() without return types