code: def test_data_driven_proposal(self):
      num_particles = 100
      observations = tf.convert_to_tensor([60.0, -179.2, 1337.42])
  
      # Define a system constrained primarily by observations, where proposing
      # from the dynamics would be a bad fit.
      initial_state_prior = normal.Normal(loc=0.0, scale=1e6)
      transition_fn = lambda _, previous_state: normal.Normal(
          loc=previous_state, scale=1e6
      )
      observation_fn = lambda _, state: normal.Normal(
          loc=state, scale=0.1
      )
      initial_state_proposal = normal.Normal(
          loc=observations[0], scale=0.1
      )
      proposal_fn = lambda step, state: normal.Normal(  # pylint: disable=g-long-lambda
          loc=tf.ones_like(state) * observations[step + 1], scale=1.0
      )
  
      trajectories, _ = self.evaluate(
          particle_filter.infer_trajectories(
              observations=observations,
              initial_state_prior=initial_state_prior,
              transition_fn=transition_fn,
              observation_fn=observation_fn,
              num_particles=num_particles,
              initial_state_proposal=initial_state_proposal,
              proposal_fn=proposal_fn,
              seed=test_util.test_seed(),
          )
      )
      self.assertAllClose(
          trajectories,
          tf.convert_to_tensor(
              tf.convert_to_tensor(observations)[..., tf.newaxis]
              * tf.ones([num_particles])
          ),
          atol=1.0,
      )
  
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 6 for calling the _ParticleFilterTest obj's underlying member method code with example usage: obj.test_data_driven_proposal() without return types