code: def testResidualFractionGradientsWithCenteredDifference(self):
      width = 4
      batch_size = 3
      target = mvn_diag.MultivariateNormalDiag(
          loc=tf.zeros(width), scale_diag=tf.ones(width)
      )
      x = tf.ones((batch_size, width))
  
      def fn(residual_fraction):
          bijector = highway_flow.HighwayFlow(
              residual_fraction=residual_fraction,
              activation_fn=tf.nn.softplus,
              bias=tf.zeros(width),
              upper_diagonal_weights_matrix=tf.eye(width),
              lower_diagonal_weights_matrix=tf.eye(width),
              gate_first_n=width,
          )
          return tf.reduce_mean(target.log_prob(bijector.forward(x)))
  
      _, auto_grad = gradient.value_and_gradient(fn, 0.5)
  
      h = 1e-3
      y1 = fn(0.5 + h)
      y2 = fn(0.5 - h)
      manual_grad = (y1 - y2) / (2 * h)
  
      self.assertAllClose(auto_grad, manual_grad, rtol=2e-4)
  
file_path: probability/tensorflow_probability/python/experimental/bijectors/highway_flow_test.py
imports: from absl.testing import parameterized
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.experimental.bijectors import highway_flow
  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 4 for calling the HighwayFlowTests obj's underlying member method code with example usage: obj.testResidualFractionGradientsWithCenteredDifference() and returns: tf