code: def test_log_prob_gradients_exist(self):
      nsteps = 7
      initial_mean = tf.constant([0.0], dtype=self.dtype)
      initial_cov = tf.eye(1, dtype=self.dtype)
      transition_matrix = tf.constant(
          nsteps * [[[1.0]]], dtype=self.dtype
      )
      transition_mean = tf.constant(nsteps * [[0.0]], dtype=self.dtype)
      transition_cov = tf.constant(nsteps * [[[1.0]]], dtype=self.dtype)
      observation_matrix = tf.constant(
          nsteps * [[[1.0]]], dtype=self.dtype
      )
      observation_mean = tf.constant(nsteps * [[0.0]], dtype=self.dtype)
      observation_cov = tf.constant(
          nsteps * [[[1.0]]], dtype=self.dtype
      )
      y = tf.ones([nsteps, 1], dtype=self.dtype)
  
      def lp(
          initial_mean,
          initial_cov,
          transition_matrix,
          transition_mean,
          transition_cov,
          observation_matrix,
          observation_mean,
          observation_cov,
          y,
      ):
          (
              log_likelihoods,
              _,
              _,
              _,
              _,
              _,
              _,
          ) = parallel_kalman_filter_lib.kalman_filter(
              transition_matrix=transition_matrix,
              transition_mean=transition_mean,
              transition_cov=transition_cov,
              observation_matrix=observation_matrix,
              observation_mean=observation_mean,
              observation_cov=observation_cov,
              initial_mean=initial_mean,
              initial_cov=initial_cov,
              y=y,
              mask=None,
          )
          return tf.reduce_sum(log_likelihoods)
  
      grads = gradient.value_and_gradient(
          lp,
          (
              initial_mean,
              initial_cov,
              transition_matrix,
              transition_mean,
              transition_cov,
              observation_matrix,
              observation_mean,
              observation_cov,
              y,
          ),
      )
      for g in grads:
          self.assertIsNotNone(g)
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.experimental.parallel_filter import parallel_kalman_filter_lib
  from tensorflow_probability.python.internal import distribution_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.math import gradient
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 4 for calling the _KalmanFilterTest obj's underlying member method code with example usage: obj.test_log_prob_gradients_exist() and returns: tf